Skip to content

Commit

Permalink
Update expected colorize result that were uncolored before
Browse files Browse the repository at this point in the history
  • Loading branch information
tompng committed Aug 10, 2022
1 parent a5bd7a6 commit a7efb93
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test/irb/test_color.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,18 @@ def test_colorize_code
"def req(@a) end" => "#{GREEN}def#{CLEAR} #{BLUE}#{BOLD}req#{CLEAR}(#{RED}#{REVERSE}@a#{CLEAR}) #{GREEN}end#{CLEAR}",
})
else
tests.merge!({
"[1]]]\u0013" => "[1]]]^S",
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7.0')
tests.merge!({
"[1]]]\u0013" => "[#{BLUE}#{BOLD}1#{CLEAR}]#{RED}#{REVERSE}]#{CLEAR}]^S",
"def req(true) end" => "#{GREEN}def#{CLEAR} #{BLUE}#{BOLD}req#{CLEAR}(#{RED}#{REVERSE}true#{CLEAR}) end",
})
else
tests.merge!({
"[1]]]\u0013" => "[#{BLUE}#{BOLD}1#{CLEAR}]]]^S",
"def req(true) end" => "#{GREEN}def#{CLEAR} #{BLUE}#{BOLD}req#{CLEAR}(#{CYAN}#{BOLD}true#{CLEAR}) end",
})
end
tests.merge!({
"def req(true) end" => "def req(true) end",
"nil = 1" => "#{CYAN}#{BOLD}nil#{CLEAR} = #{BLUE}#{BOLD}1#{CLEAR}",
"alias $x $1" => "#{GREEN}alias#{CLEAR} #{GREEN}#{BOLD}$x#{CLEAR} $1",
"class bad; end" => "#{GREEN}class#{CLEAR} bad; #{GREEN}end#{CLEAR}",
Expand Down

0 comments on commit a7efb93

Please sign in to comment.