diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-29 00:05:45 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-29 00:05:45 +0000 |
commit | e42f4ae77363e0b85587e67fb86603123bfbd3cb (patch) | |
tree | 886607e57aef09ede4ffa504b1367cd0bb1bc7de /test | |
parent | c1718e988e24de48bf8ebe8d2421b4531dbe7b58 (diff) |
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/trunk@63030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_array.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index 1ff13c7736..6f4999386f 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -535,6 +535,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! |