summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-array-ext/test
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2018-09-21 00:01:48 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2018-09-21 00:01:48 +0900
commitf23f2bbdad7a15bec8812b029cb23c2117d7c63c (patch)
tree8e310268b491f6b59673e36a94be4bbd30b778f7 /mrbgems/mruby-array-ext/test
parentdd346be99aaf6d0220f067c78decb29548c7dfe6 (diff)
downloadmruby-f23f2bbdad7a15bec8812b029cb23c2117d7c63c.tar.gz
mruby-f23f2bbdad7a15bec8812b029cb23c2117d7c63c.zip
Implement `Array#union` which is introduced in Ruby2.6.
Diffstat (limited to 'mrbgems/mruby-array-ext/test')
-rw-r--r--mrbgems/mruby-array-ext/test/array.rb8
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 4f54c65c3..84f9cfeaf 100644
--- a/mrbgems/mruby-array-ext/test/array.rb
+++ b/mrbgems/mruby-array-ext/test/array.rb
@@ -75,6 +75,14 @@ assert("Array#|") do
assert_equal [1, 2, 3, 1], a
end
+assert("Array#union") do
+ a = [1, 2, 3, 1]
+ b = [1, 4]
+ c = [1, 5]
+
+ assert_equal [1, 2, 3, 4, 5], a.union(b,c)
+end
+
assert("Array#&") do
a = [1, 2, 3, 1]
b = [1, 4]