From f23f2bbdad7a15bec8812b029cb23c2117d7c63c Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Fri, 21 Sep 2018 00:01:48 +0900 Subject: Implement `Array#union` which is introduced in Ruby2.6. --- mrbgems/mruby-array-ext/test/array.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mrbgems/mruby-array-ext/test/array.rb') 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] -- cgit v1.2.3