1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* compile.c (iseq_compile_each), parse.y (stmt, arg): arg_concat()

on op_asgn was inversed.  [ruby-core:25629] [Bug #2050]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-09-18 07:15:06 +00:00
parent 6200f424a7
commit 8686840960
4 changed files with 19 additions and 6 deletions

View file

@ -77,6 +77,14 @@ class TestAssignment < Test::Unit::TestCase
a,b,*c = *[*[]]; assert_equal([nil,nil,[]], [a,b,c])
a,b,*c = *[*[1]]; assert_equal([1,nil,[]], [a,b,c])
a,b,*c = *[*[1,2]]; assert_equal([1,2,[]], [a,b,c])
bug2050 = '[ruby-core:25629]'
a = Hash.new {[]}
b = [1, 2]
assert_equal([1, 2, 3], a[:x] += [*b, 3], bug2050)
assert_equal([1, 2, 3], a[:x], bug2050)
assert_equal([1, 2, 3, [1, 2, 3]], a[:x] <<= [*b, 3], bug2050)
assert_equal([1, 2, 3, [1, 2, 3]], a[:x], bug2050)
end
def test_yield