diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-12-01 18:41:23 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2016-12-01 18:41:23 +0900 |
| commit | 4d807fc619e7feccd2bc079ef76a9e817e36fa59 (patch) | |
| tree | d8f939ff77ceaa32cba522885530ef8fd22daa8e /test/t/array.rb | |
| parent | ab4ab7c8a0e5226e4a76f7c37bdb79d2c92c004f (diff) | |
| parent | 3f83ec64a82410cdc16863f8242eaea30dec026f (diff) | |
| download | mruby-4d807fc619e7feccd2bc079ef76a9e817e36fa59.tar.gz mruby-4d807fc619e7feccd2bc079ef76a9e817e36fa59.zip | |
Merge pull request #3313 from yhara/add-test
Add test for recently fixed bugs
Diffstat (limited to 'test/t/array.rb')
| -rw-r--r-- | test/t/array.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/t/array.rb b/test/t/array.rb index 3c5211591..9cc2f64ad 100644 --- a/test/t/array.rb +++ b/test/t/array.rb @@ -82,6 +82,14 @@ assert('Array#[]=', '15.2.12.5.5') do a = [1,2,3,4,5] a[2...4] = 6 assert_equal([1,2,6,5], a) + + # passing self (#3274) + a = [1,2,3] + a[1,0] = a + assert_equal([1,1,2,3,2,3], a) + a = [1,2,3] + a[-1,0] = a + assert_equal([1,2,1,2,3,3], a) end assert('Array#clear', '15.2.12.5.6') do @@ -98,6 +106,11 @@ end assert('Array#concat', '15.2.12.5.8') do assert_equal([1,2,3,4], [1, 2].concat([3, 4])) + + # passing self (#3302) + a = [1,2,3] + a.concat(a) + assert_equal([1,2,3,1,2,3], a) end assert('Array#delete_at', '15.2.12.5.9') do |
