1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Mask RubyVM-specific test

This commit is contained in:
Charles Oliver Nutter 2020-03-05 16:48:52 -06:00
parent 17d5efa4fe
commit e57dd8c2b5
No known key found for this signature in database
GPG key ID: 8E26FF248BC7AEAD

View file

@ -211,12 +211,14 @@ class PPFileStatTest < Test::Unit::TestCase
end
end
class PPAbstractSyntaxTree < Test::Unit::TestCase
AST = RubyVM::AbstractSyntaxTree
def test_lasgn_literal
ast = AST.parse("_=1")
expected = "(SCOPE@1:0-1:3 tbl: [:_] args: nil body: (LASGN@1:0-1:3 :_ (LIT@1:2-1:3 1)))"
assert_equal(expected, PP.singleline_pp(ast, ''.dup), ast)
if defined?(RubyVM)
class PPAbstractSyntaxTree < Test::Unit::TestCase
AST = RubyVM::AbstractSyntaxTree
def test_lasgn_literal
ast = AST.parse("_=1")
expected = "(SCOPE@1:0-1:3 tbl: [:_] args: nil body: (LASGN@1:0-1:3 :_ (LIT@1:2-1:3 1)))"
assert_equal(expected, PP.singleline_pp(ast, ''.dup), ast)
end
end
end