diff options
| author | mirichi <[email protected]> | 2014-04-23 19:03:35 +0900 |
|---|---|---|
| committer | mirichi <[email protected]> | 2014-04-23 19:03:35 +0900 |
| commit | b27d665d2d80b71f3c88aee75fa4037e5a469998 (patch) | |
| tree | f3a39c6f8078b72e0f7a93a2dd3a48a41e0ab69c /mrbgems/mruby-array-ext/test | |
| parent | e6c757b5c190429832c057ea5ecea3ed33484276 (diff) | |
| parent | f2204ee524810f3598d97b7b8c184af98d2f94d9 (diff) | |
| download | mruby-b27d665d2d80b71f3c88aee75fa4037e5a469998.tar.gz mruby-b27d665d2d80b71f3c88aee75fa4037e5a469998.zip | |
Merge remote-tracking branch 'remotes/mruby/master' into enhance
Diffstat (limited to 'mrbgems/mruby-array-ext/test')
| -rw-r--r-- | mrbgems/mruby-array-ext/test/array.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mrbgems/mruby-array-ext/test/array.rb b/mrbgems/mruby-array-ext/test/array.rb index 0b425281f..d15ea2a64 100644 --- a/mrbgems/mruby-array-ext/test/array.rb +++ b/mrbgems/mruby-array-ext/test/array.rb @@ -197,3 +197,12 @@ assert("Array#reject!") do assert_equal [1, 2, 3], a.reject! { |val| val > 3 } assert_equal [1, 2, 3], a end + +assert("Array#insert") do + a = ["a", "b", "c", "d"] + assert_equal ["a", "b", 99, "c", "d"], a.insert(2, 99) + assert_equal ["a", "b", 99, "c", 1, 2, 3, "d"], a.insert(-2, 1, 2, 3) + + b = ["a", "b", "c", "d"] + assert_equal ["a", "b", "c", "d", nil, nil, 99], b.insert(6, 99) +end |
