diff options
| author | Jun Hiroe <[email protected]> | 2014-04-18 21:57:11 +0900 |
|---|---|---|
| committer | Jun Hiroe <[email protected]> | 2014-04-18 23:13:02 +0900 |
| commit | 80646a7890a0e786f7f6f1614a519eccae3b0341 (patch) | |
| tree | 80a6a63b2dee91c9f4767d6c6d7b68ae0bf58f1b /mrbgems/mruby-array-ext/test/array.rb | |
| parent | 4918e5ec65511728594319d389af78a610997eb8 (diff) | |
| download | mruby-80646a7890a0e786f7f6f1614a519eccae3b0341.tar.gz mruby-80646a7890a0e786f7f6f1614a519eccae3b0341.zip | |
Add a block argument with Array#uniq_bang
Diffstat (limited to 'mrbgems/mruby-array-ext/test/array.rb')
| -rw-r--r-- | mrbgems/mruby-array-ext/test/array.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mrbgems/mruby-array-ext/test/array.rb b/mrbgems/mruby-array-ext/test/array.rb index 9a0f25f9a..3be17f187 100644 --- a/mrbgems/mruby-array-ext/test/array.rb +++ b/mrbgems/mruby-array-ext/test/array.rb @@ -36,6 +36,12 @@ assert("Array#uniq!") do b = [ "a", "b", "c" ] assert_nil b.uniq! + + c = [["student","sam"], ["student","george"], ["teacher","matz"]] + assert_equal [["student", "sam"], ["teacher", "matz"]], c.uniq! { |s| s.first } + + d = [["student","sam"], ["teacher","matz"]] + assert_nil d.uniq! { |s| s.first } end assert("Array#uniq") do |
