1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2021-07-29 22:11:21 +02:00
parent 15d05f8120
commit 6998d75824
186 changed files with 3956 additions and 3339 deletions

View file

@ -154,24 +154,22 @@ describe "Array#slice!" do
-> { ArraySpecs.frozen_array.slice!(0, 0) }.should raise_error(FrozenError)
end
ruby_version_is "2.6" do
it "works with endless ranges" do
a = [1, 2, 3]
a.slice!(eval("(1..)")).should == [2, 3]
a.should == [1]
it "works with endless ranges" do
a = [1, 2, 3]
a.slice!(eval("(1..)")).should == [2, 3]
a.should == [1]
a = [1, 2, 3]
a.slice!(eval("(2...)")).should == [3]
a.should == [1, 2]
a = [1, 2, 3]
a.slice!(eval("(2...)")).should == [3]
a.should == [1, 2]
a = [1, 2, 3]
a.slice!(eval("(-2..)")).should == [2, 3]
a.should == [1]
a = [1, 2, 3]
a.slice!(eval("(-2..)")).should == [2, 3]
a.should == [1]
a = [1, 2, 3]
a.slice!(eval("(-1...)")).should == [3]
a.should == [1, 2]
end
a = [1, 2, 3]
a.slice!(eval("(-1...)")).should == [3]
a.should == [1, 2]
end
ruby_version_is "2.7" do