diff options
Diffstat (limited to 'test')
-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 23cd5618a0..1a897ef502 100644 --- a/test/ruby/test_ast.rb +++ b/test/ruby/test_ast.rb @@ -257,4 +257,16 @@ class TestAst < Test::Unit::TestCase assert_equal(:b, mid) assert_equal(:SCOPE, defn.type) 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 |