Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f5cee21

Browse files
committedFeb 21, 2024
Fix compatibility with 3.3 or earlier
1 parent 6718ddf commit f5cee21

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎test/test_pp.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ class PPAbstractSyntaxTree < Test::Unit::TestCase
238238
AST = RubyVM::AbstractSyntaxTree
239239
def test_lasgn_literal
240240
ast = AST.parse("_=1")
241-
expected = "(SCOPE@1:0-1:3 tbl: [:_] args: nil body: (LASGN@1:0-1:3 :_ (INTEGER@1:2-1:3 1)))"
241+
integer = RUBY_VERSION >= "3.4." ? "INTEGER" : "LIT"
242+
expected = "(SCOPE@1:0-1:3 tbl: [:_] args: nil body: (LASGN@1:0-1:3 :_ (#{integer}@1:2-1:3 1)))"
242243
assert_equal(expected, PP.singleline_pp(ast, ''.dup), ast)
243244
end
244245
end

0 commit comments

Comments
 (0)
Please sign in to comment.