diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2019-06-04 00:29:53 +0900 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2019-06-04 00:29:54 +0900 |
commit | d21a694075866f4a3333cf65910a649acd057306 (patch) | |
tree | 58b1daa51915f59f65114aa851ae5d4f62c9d368 | |
parent | de541fe1961370e64541d73c96cf790d30f28604 (diff) |
Improve test_color to prevent regression
Actually de541fe1961370e64541d73c96cf790d30f28604 was still needed.
This commit would improve the test coverage using the branch.
-rw-r--r-- | test/irb/test_color.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/test/irb/test_color.rb b/test/irb/test_color.rb index ae6e02afa9..7a128295ed 100644 --- a/test/irb/test_color.rb +++ b/test/irb/test_color.rb @@ -40,7 +40,7 @@ module TestIRB '/r#{e}g/' => "#{RED}#{BOLD}/#{CLEAR}#{RED}r#{CLEAR}#{RED}\#{#{CLEAR}e#{RED}}#{CLEAR}#{RED}g#{CLEAR}#{RED}#{BOLD}/#{CLEAR}", "'a\nb'" => "#{RED}'#{CLEAR}#{RED}a#{CLEAR}\n#{RED}b#{CLEAR}#{RED}'#{CLEAR}", "4.5.6" => "#{MAGENTA}#{BOLD}4.5#{CLEAR}#{RED}#{REVERSE}.6#{CLEAR}", - "[1]]]" => "[1]]]", + "[1]]]\u0013" => "[1]]]^S", "\e[0m\n" => "#{RED}#{REVERSE}^[#{CLEAR}[#{BLUE}#{BOLD}0#{CLEAR}m\n", "%w[a b]" => "#{RED}%w[#{CLEAR}#{RED}a#{CLEAR} #{RED}b#{CLEAR}#{RED}]#{CLEAR}", "%i[c d]" => "#{RED}%i[#{CLEAR}#{RED}c#{CLEAR} #{RED}d#{CLEAR}#{RED}]#{CLEAR}", @@ -69,7 +69,6 @@ module TestIRB "\t" => "\t", # not ^I "foo(*%W(bar))" => "foo(*#{RED}%W(#{CLEAR}#{RED}bar#{CLEAR}#{RED})#{CLEAR})", "$stdout" => "#{GREEN}#{BOLD}$stdout#{CLEAR}", - "\u0013" => "#{RED}#{REVERSE}^S#{CLEAR}", }.each do |code, result| actual = with_term { IRB::Color.colorize_code(code, complete: true) } assert_equal(result, actual, "Case: colorize_code(#{code.dump}, complete: true)\nResult: #{humanized_literal(actual)}") |