diff options
Diffstat (limited to 'test')
-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 |