diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-08-29 10:32:12 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-08-29 10:35:00 +0900 |
commit | 523bf31564f160f899f8cf9f73540d6a6f687f17 (patch) | |
tree | 6e0fae074be862b127c1ac72ab14c04305545fb1 /test/ruby | |
parent | 5dc36ddcd00fc556c04c15ce9770c5a84d7d43dc (diff) |
Add negative position tests [Bug #18138]
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_array.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index 78e497d345..59e1ad463c 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -1576,6 +1576,8 @@ class TestArray < Test::Unit::TestCase assert_nil(a.slice(10, -3)) assert_equal @cls[], a.slice(10..7) + + assert_equal([100], a.slice(-1, 1_000_000_000)) end def test_slice! @@ -1635,6 +1637,8 @@ class TestArray < Test::Unit::TestCase assert_nil(a.clone.slice!(10, -3)) assert_equal @cls[], a.clone.slice!(10..7) + + assert_equal([100], a.clone.slice!(-1, 1_000_000_000)) end def test_sort |