summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-28 07:37:22 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-28 07:37:22 +0000
commit3f23ee7015448fbc33515dd8168c7b4d370c26e4 (patch)
treef9ce8f908fee424089f3be9aa34cbb9486e18e74 /test/ruby
parentbcafeef2e753b4f02bea2e73bd5082bb789bea26 (diff)
merge revision(s) 48484: [Backport #10524]
* parse.y (symbol_list): fix the node type of literal symbol list with no interpolation. [ruby-core:66343] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@48635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_literal.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_literal.rb b/test/ruby/test_literal.rb
index e4c35e03d9..5fa326acfe 100644
--- a/test/ruby/test_literal.rb
+++ b/test/ruby/test_literal.rb
@@ -434,4 +434,14 @@ class TestRubyLiteral < Test::Unit::TestCase
}
end
+ def test_symbol_list
+ assert_equal([:foo, :bar], %i[foo bar])
+ assert_equal([:"\"foo"], %i["foo])
+
+ x = 10
+ assert_equal([:foo, :b10], %I[foo b#{x}])
+ assert_equal([:"\"foo10"], %I["foo#{x}])
+
+ assert_ruby_status(["--disable-gems", "--dump=parsetree"], "%I[foo bar]")
+ end
end