diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-18 19:16:27 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-18 19:16:27 +0000 |
commit | 5023492957351796cbde1db1d60c3a5ab5771ccf (patch) | |
tree | b58ea3ec5dc6c7f4626a0a8a52f3f8ec402b4be8 /test/ruby | |
parent | 20fe728a2450a230cfb6d04f94a178db619dc6a7 (diff) | |
download | ruby-5023492957351796cbde1db1d60c3a5ab5771ccf.tar.gz |
parse.y: fix literal symbol list node type
* 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/trunk@48484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_literal.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_literal.rb b/test/ruby/test_literal.rb index 036be5f470..6c1123d38e 100644 --- a/test/ruby/test_literal.rb +++ b/test/ruby/test_literal.rb @@ -433,4 +433,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 |