summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2024-02-22 01:35:53 +0900
committergit <[email protected]>2024-02-21 16:39:17 +0000
commitd9ebb65b7958551dcc73b80815ea639e6187b62d (patch)
treedec76d755fa6e8b4894c6fde1753e76c03eeba13
parent330830dd1a44b6e497250a14d93efae6fa363f82 (diff)
[ruby/pp] Fix compatibility with 3.3 or earlier
https://github.com/ruby/pp/commit/f5cee21a1e
-rw-r--r--test/test_pp.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/test_pp.rb b/test/test_pp.rb
index 26e730fd00..f6bd2162d0 100644
--- a/test/test_pp.rb
+++ b/test/test_pp.rb
@@ -238,7 +238,8 @@ if defined?(RubyVM)
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 :_ (INTEGER@1:2-1:3 1)))"
+ integer = RUBY_VERSION >= "3.4." ? "INTEGER" : "LIT"
+ expected = "(SCOPE@1:0-1:3 tbl: [:_] args: nil body: (LASGN@1:0-1:3 :_ (#{integer}@1:2-1:3 1)))"
assert_equal(expected, PP.singleline_pp(ast, ''.dup), ast)
end
end