diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-18 07:15:06 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-18 07:15:06 +0000 |
commit | 868684096079f3e786df517714fe6d795c4647b6 (patch) | |
tree | f4534afac345b2b08542fde02b09323861a12d96 /test/ruby | |
parent | 6200f424a721981d739410ea3937990e3831bc7d (diff) | |
download | ruby-868684096079f3e786df517714fe6d795c4647b6.tar.gz |
* 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
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_assignment.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_assignment.rb b/test/ruby/test_assignment.rb index b82cee81d1..e38b20b285 100644 --- a/test/ruby/test_assignment.rb +++ b/test/ruby/test_assignment.rb @@ -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 |