summaryrefslogtreecommitdiff
path: root/test/ruby/test_ast.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_ast.rb')
-rw-r--r--test/ruby/test_ast.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb
index 055567d574..ed4bcb37c0 100644
--- a/test/ruby/test_ast.rb
+++ b/test/ruby/test_ast.rb
@@ -249,4 +249,13 @@ class TestAst < Test::Unit::TestCase
assert_equal(:b, mid)
assert_equal(:SCOPE, defn.type)
end
+
+ def test_methref
+ node = RubyVM::AbstractSyntaxTree.parse("obj.:foo")
+ _, _, body = *node.children
+ assert_equal(:METHREF, body.type)
+ recv, mid = body.children
+ assert_equal(:VCALL, recv.type)
+ assert_equal(:foo, mid)
+ end
end