summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-11 13:51:19 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-11 13:51:19 +0000
commitea15ceddbef2cc4c459c1ad5796e43ae9fa2cbf1 (patch)
tree25a9cab3921e01da6ea770fc3262068e2233e295 /test
parent49d542f6d32381c44721fd4a89e423d489c8bec7 (diff)
merge revision(s) 63030: [Backport #14639]
array.c: yield blockarg in collect * array.c (rb_ary_collect): yield in block argument semantics always to splat array elements to lambda, for the backward compatibility. [ruby-core:86362] [Bug #14639] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@64996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_array.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb
index f12c8bb302..73a0bf24d0 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -534,6 +534,8 @@ class TestArray < Test::Unit::TestCase
# Enumerable#collect without block returns an Enumerator.
#assert_equal([1, 2, 3], @cls[1, 2, 3].collect)
assert_kind_of Enumerator, @cls[1, 2, 3].collect
+
+ assert_equal([[1, 2, 3]], [[1, 2, 3]].collect(&->(a, b, c) {[a, b, c]}))
end
# also update map!