summaryrefslogtreecommitdiff
path: root/test/irb
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2019-06-04 00:22:22 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-06-04 00:26:02 +0900
commitde541fe1961370e64541d73c96cf790d30f28604 (patch)
treee0dff25bcc3c45dd846d2375c25a405cb36ca812 /test/irb
parent6498c733da4f34aca47ca88412605761467a2fec (diff)
colorize_code must return escaped text
This was needed before 0c459af7c233adb5f44022350bfe8fa132d8053e but it could be actually useless now. But I added this anyway just in case.
Diffstat (limited to 'test/irb')
-rw-r--r--test/irb/test_color.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/irb/test_color.rb b/test/irb/test_color.rb
index d327d617fa..ae6e02afa9 100644
--- a/test/irb/test_color.rb
+++ b/test/irb/test_color.rb
@@ -69,6 +69,7 @@ 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)}")
@@ -79,7 +80,7 @@ module TestIRB
end
def test_colorize_code_complete_true
- # `complete: true` behaviors. Warn end-of-file.
+ # `complete: true` behaviors. Warn compile_error.
{
"'foo' + 'bar" => "#{RED}'#{CLEAR}#{RED}foo#{CLEAR}#{RED}'#{CLEAR} + #{RED}'#{CLEAR}#{RED}#{REVERSE}bar#{CLEAR}",
}.each do |code, result|
@@ -89,7 +90,7 @@ module TestIRB
end
def test_colorize_code_complete_false
- # `complete: false` behaviors. Do not warn end-of-file
+ # `complete: false` behaviors. Do not warn compile_error.
{
"'foo' + 'bar" => "#{RED}'#{CLEAR}#{RED}foo#{CLEAR}#{RED}'#{CLEAR} + #{RED}'#{CLEAR}#{RED}bar#{CLEAR}",
}.each do |code, result|