diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-14 10:16:54 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-14 10:16:54 +0000 |
commit | 4d727639b45a43e73ec8588e837f74315dafa619 (patch) | |
tree | a539a4b93057b1d9744467dbe03f47489c049498 /test/ruby/test_ast.rb | |
parent | ec3cdb34ce6f19be7a6d887357fd1763f97992d1 (diff) | |
download | ruby-4d727639b45a43e73ec8588e837f74315dafa619.tar.gz |
ast.c: fix missing head part in dynamic literal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_ast.rb')
-rw-r--r-- | test/ruby/test_ast.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb index d57b60b3f7..974dfb77fb 100644 --- a/test/ruby/test_ast.rb +++ b/test/ruby/test_ast.rb @@ -266,4 +266,16 @@ class TestAst < Test::Unit::TestCase assert_equal(:VCALL, recv.type) assert_equal(:foo, mid) end + + def test_dstr + node = RubyVM::AbstractSyntaxTree.parse('"foo#{1}bar"') + _, _, body = *node.children + assert_equal(:DSTR, body.type) + head, body = body.children + assert_equal("foo", head) + assert_equal(:EVSTR, body.type) + body, = body.children + assert_equal(:LIT, body.type) + assert_equal([1], body.children) + end end |