mirror of
https://github.com/ruby/ruby.git
synced 2025-09-22 03:53:58 +02:00
Add negative position tests [Bug #18138]
This commit is contained in:
parent
5dc36ddcd0
commit
523bf31564
1 changed files with 4 additions and 0 deletions
|
@ -1576,6 +1576,8 @@ class TestArray < Test::Unit::TestCase
|
||||||
|
|
||||||
assert_nil(a.slice(10, -3))
|
assert_nil(a.slice(10, -3))
|
||||||
assert_equal @cls[], a.slice(10..7)
|
assert_equal @cls[], a.slice(10..7)
|
||||||
|
|
||||||
|
assert_equal([100], a.slice(-1, 1_000_000_000))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_slice!
|
def test_slice!
|
||||||
|
@ -1635,6 +1637,8 @@ class TestArray < Test::Unit::TestCase
|
||||||
|
|
||||||
assert_nil(a.clone.slice!(10, -3))
|
assert_nil(a.clone.slice!(10, -3))
|
||||||
assert_equal @cls[], a.clone.slice!(10..7)
|
assert_equal @cls[], a.clone.slice!(10..7)
|
||||||
|
|
||||||
|
assert_equal([100], a.clone.slice!(-1, 1_000_000_000))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_sort
|
def test_sort
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue