Skip to content

Commit a7efb93

Browse files
committed
Update expected colorize result that were uncolored before
1 parent a5bd7a6 commit a7efb93

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

test/irb/test_color.rb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,18 @@ def test_colorize_code
114114
"def req(@a) end" => "#{GREEN}def#{CLEAR} #{BLUE}#{BOLD}req#{CLEAR}(#{RED}#{REVERSE}@a#{CLEAR}) #{GREEN}end#{CLEAR}",
115115
})
116116
else
117-
tests.merge!({
118-
"[1]]]\u0013" => "[1]]]^S",
117+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7.0')
118+
tests.merge!({
119+
"[1]]]\u0013" => "[#{BLUE}#{BOLD}1#{CLEAR}]#{RED}#{REVERSE}]#{CLEAR}]^S",
120+
"def req(true) end" => "#{GREEN}def#{CLEAR} #{BLUE}#{BOLD}req#{CLEAR}(#{RED}#{REVERSE}true#{CLEAR}) end",
121+
})
122+
else
123+
tests.merge!({
124+
"[1]]]\u0013" => "[#{BLUE}#{BOLD}1#{CLEAR}]]]^S",
125+
"def req(true) end" => "#{GREEN}def#{CLEAR} #{BLUE}#{BOLD}req#{CLEAR}(#{CYAN}#{BOLD}true#{CLEAR}) end",
119126
})
127+
end
120128
tests.merge!({
121-
"def req(true) end" => "def req(true) end",
122129
"nil = 1" => "#{CYAN}#{BOLD}nil#{CLEAR} = #{BLUE}#{BOLD}1#{CLEAR}",
123130
"alias $x $1" => "#{GREEN}alias#{CLEAR} #{GREEN}#{BOLD}$x#{CLEAR} $1",
124131
"class bad; end" => "#{GREEN}class#{CLEAR} bad; #{GREEN}end#{CLEAR}",

0 commit comments

Comments
 (0)