mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@8cafaa5
This commit is contained in:
parent
1b377b32c8
commit
2e32b919b4
35 changed files with 832 additions and 10 deletions
|
@ -335,6 +335,16 @@ describe :string_slice_range, shared: true do
|
|||
"hello there".send(@method, eval("(-4...)")).should == "here"
|
||||
end
|
||||
end
|
||||
|
||||
ruby_version_is "2.7" do
|
||||
it "works with beginless ranges" do
|
||||
"hello there".send(@method, eval("(..5)")).should == "hello "
|
||||
"hello there".send(@method, eval("(...5)")).should == "hello"
|
||||
"hello there".send(@method, eval("(..-4)")).should == "hello th"
|
||||
"hello there".send(@method, eval("(...-4)")).should == "hello t"
|
||||
"hello there".send(@method, eval("(...nil)")).should == "hello there"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe :string_slice_regexp, shared: true do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue