diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-15 18:35:13 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-15 18:35:13 +0900 |
| commit | 6b457d2c006c333bfdc1328ecc73db7e63a6aca5 (patch) | |
| tree | d4175aeefd1bf78893e21dda70615127594ad29f /test/t/array.rb | |
| parent | c779413df39ef7d96583bda08104491c55049fad (diff) | |
| parent | bec4d053400c3a11c8efd68c3e8bd5ea4a0bcc54 (diff) | |
| download | mruby-6b457d2c006c333bfdc1328ecc73db7e63a6aca5.tar.gz mruby-6b457d2c006c333bfdc1328ecc73db7e63a6aca5.zip | |
Merge branch 'work_for_merge' of https://github.com/zubycz/mruby into zubycz-work_for_merge
Diffstat (limited to 'test/t/array.rb')
| -rw-r--r-- | test/t/array.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/t/array.rb b/test/t/array.rb index 2982cab01..b3952e5a5 100644 --- a/test/t/array.rb +++ b/test/t/array.rb @@ -57,6 +57,7 @@ assert('Array#[]', '15.2.12.5.4') do a = [ "a", "b", "c", "d", "e" ] assert_equal(["b", "c"], a[1,2]) assert_equal(["b", "c", "d"], a[1..-2]) + assert_equal(["b", "c", "d", "e"], a[1..]) skip unless Object.const_defined?(:Float) assert_equal("b", a[1.1]) end @@ -92,6 +93,10 @@ assert('Array#[]=', '15.2.12.5.5') do a[2...4] = 6 assert_equal([1,2,6,5], a) + a = [1,2,3,4,5] + a[2...] = 6 + assert_equal([1,2,6], a) + # passing self (#3274) a = [1,2,3] a[1,0] = a |
