From f5cee21a1e03c04e35e02326d115bbe913cecfd1 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 22 Feb 2024 01:35:53 +0900 Subject: [PATCH] Fix compatibility with 3.3 or earlier --- test/test_pp.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test_pp.rb b/test/test_pp.rb index 26e730f..f6bd216 100644 --- a/test/test_pp.rb +++ b/test/test_pp.rb @@ -238,7 +238,8 @@ 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 :_ (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