mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Add RubyVM::AST#pretty_print
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b56e266d64
commit
87e1dd2982
2 changed files with 39 additions and 0 deletions
|
@ -194,4 +194,13 @@ class PPFileStatTest < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class PPAbstractSyntaxTree < Test::Unit::TestCase
|
||||
AST = RubyVM::AbstractSyntaxTree
|
||||
def test_literal
|
||||
ast = AST.parse("1")
|
||||
expected = "(SCOPE@1:0-1:1 tbl: [] args: nil body: (LIT@1:0-1:1 1))"
|
||||
assert_equal(expected, PP.singleline_pp(ast, ''.dup))
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue