From a011fe4908e47a5d66175284c4df91ae42665ac1 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Mon, 17 Oct 2022 13:58:12 +0900 Subject: [PATCH] Backport irb test case update from ruby/ruby https://github.com/ruby/ruby/commit/4bfdf6d06ddbcf21345461038f2a9e3012f77268#diff-94ce008f65ce4e81af80c6b8d457eb71f40a91c89337402cffe5af9111496938 --- test/irb/test_color.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/irb/test_color.rb b/test/irb/test_color.rb index dc394f9d6..8de03a5e8 100644 --- a/test/irb/test_color.rb +++ b/test/irb/test_color.rb @@ -114,6 +114,11 @@ def test_colorize_code "class bad; end" => "#{GREEN}class#{CLEAR} #{RED}#{REVERSE}bad#{CLEAR}; #{GREEN}end#{CLEAR}", "def req(@a) end" => "#{GREEN}def#{CLEAR} #{BLUE}#{BOLD}req#{CLEAR}(#{RED}#{REVERSE}@a#{CLEAR}) #{GREEN}end#{CLEAR}", }) + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.2.0') + tests.merge!({ + "def req(true) end" => "#{GREEN}def#{CLEAR} #{BLUE}#{BOLD}req#{CLEAR}(#{RED}#{REVERSE}true#{CLEAR}#{RED}#{REVERSE})#{CLEAR} #{RED}#{REVERSE}end#{CLEAR}", + }) + end else if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7.0') tests.merge!({