diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-04-17 17:38:44 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-04-17 17:38:44 +0900 |
| commit | 737254588b272ea898ebddd9fc4307fa555ddc35 (patch) | |
| tree | 539505549d74f97586660e76b7300a47776e18f9 /mrbgems/mruby-array-ext/test | |
| parent | 9d32d440ebf1ebd0684f5349316a15602bea5421 (diff) | |
| download | mruby-737254588b272ea898ebddd9fc4307fa555ddc35.tar.gz mruby-737254588b272ea898ebddd9fc4307fa555ddc35.zip | |
array.rb: add `Array#intersect?` from Ruby3.0.1.
Diffstat (limited to 'mrbgems/mruby-array-ext/test')
| -rw-r--r-- | mrbgems/mruby-array-ext/test/array.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mrbgems/mruby-array-ext/test/array.rb b/mrbgems/mruby-array-ext/test/array.rb index 2955ef391..3f73ad8b9 100644 --- a/mrbgems/mruby-array-ext/test/array.rb +++ b/mrbgems/mruby-array-ext/test/array.rb @@ -119,6 +119,14 @@ assert("Array#intersection") do assert_equal [1, 8], a.intersection(b,c) end +assert("Array#intersect?") do + a = [ 1, 2, 3 ] + b = [ 3, 4, 5 ] + c = [ 5, 6, 7 ] + assert_true(a.intersect?(b)) + assert_false(a.intersect?(c)) +end + assert("Array#flatten") do assert_equal [1, 2, "3", {4=>5}, :'6'], [1, 2, "3", {4=>5}, :'6'].flatten assert_equal [1, 2, 3, 4, 5, 6], [1, 2, [3, 4, 5], 6].flatten |
