diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-05 12:32:02 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-05 12:32:02 +0000 |
commit | 5ffe59faf8ad8f3ccfa39ec1d0d1791dfc02ac55 (patch) | |
tree | 8a9ff9f04876d8305dad394a36c7eb9fff86bddf /test/ruby | |
parent | fa9d53d00faa6fb038f6e61570adb51b201276df (diff) | |
download | ruby-5ffe59faf8ad8f3ccfa39ec1d0d1791dfc02ac55.tar.gz |
* compile.c (NODE_ARGSCAT, NODE_ARGSPUSH): drop unused ARGSCAT
results when poped is true. [ruby-dev:41933], [Bug #3658]
This is retry of r28870 and r28873 which were reverted.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_primitive.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/ruby/test_primitive.rb b/test/ruby/test_primitive.rb index d701348f26..02dab78233 100644 --- a/test/ruby/test_primitive.rb +++ b/test/ruby/test_primitive.rb @@ -400,4 +400,24 @@ class TestRubyPrimitive < Test::Unit::TestCase #assert_equal [0,1,2,3,4], [0, *a, 4] end + def test_concatarray_ruby_dev_41933 + bug3658 = '[ruby-dev:41933]' + [0, *x=1] + assert_equal(1, x, bug3658) + [0, *x=1, 2] + assert_equal(1, x, bug3658) + class << (x = Object.new) + attr_accessor :to_a_called + def to_a + @to_a_called = true + [self] + end + end + x.to_a_called = false + [0, *x] + assert(x.to_a_called, bug3658) + x.to_a_called = false + [0, *x, 2] + assert(x.to_a_called, bug3658) + end end |