diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index b4f35af..dc52d2b 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -2340,4 +2340,40 @@ class TestArray < Test::Unit::TestCase assert_include([4, 7], a.bsearch {|x| (2**100).coerce((1 - x / 4) * (2**100)).first }) end + + def test_array_no_comma + feature8956 = [ + :foo, + :bar, + [ + :baz, + :qux + ] + ] + + assert_equal(feature8956, [ + :foo + :bar + [ + :baz + :qux + ] + ]) + assert_equal(feature8956, @cls[ + :foo + :bar + [ + :baz + :qux + ] + ]) + assert_equal(feature8956, @cls.[]( + :foo + :bar + [ + :baz + :qux + ] + )) + end end diff --git a/test/ruby/test_call.rb b/test/ruby/test_call.rb index 8f861d9..5e6e062 100644 --- a/test/ruby/test_call.rb +++ b/test/ruby/test_call.rb @@ -16,4 +16,15 @@ class TestCall < Test::Unit::TestCase assert_equal([1, 2, 3, 4], aaa(1, 2, 3, 4)) assert_equal([1, 2, 3, 4], aaa(1, *[2, 3, 4])) end + + def test_call_no_comma + assert_equal([1, 2], aaa(1 + 2)) + assert_equal([1, 2, 3, 4], aaa(1 + 2 + 3 + 4)) + assert_equal([1, 2, 3, 4], aaa(1 + *[2, 3, 4])) + end end diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb index 21fbf41..3bddcdd 100644 --- a/test/ruby/test_hash.rb +++ b/test/ruby/test_hash.rb @@ -995,6 +995,42 @@ class TestHash < Test::Unit::TestCase end end + def test_hash_no_comma + feature8956 = { + :foo => 'bar', + :bar => 'foo', + :baz => { + :qux => 'quux', + :corge => 'grault' + } + } + + assert_equal(feature8956, { + :foo => 'bar' + :bar => 'foo' + :baz => { + :qux => 'quux' + :corge => 'grault' + } + }) + assert_equal(feature8956, @cls[ + :foo => 'bar' + :bar => 'foo' + :baz => { + :qux => 'quux' + :corge => 'grault' + } + ]) + assert_equal(feature8956, @cls.[]( + :foo => 'bar' + :bar => 'foo' + :baz => { + :qux => 'quux' + :corge => 'grault' + } + )) + end + class TestSubHash < TestHash class SubHash < Hash end