summaryrefslogtreecommitdiff
path: root/test/irb
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2019-05-24 21:21:22 -0700
committerTakashi Kokubun <takashikkbn@gmail.com>2019-05-24 23:54:52 -0700
commitb83119be9e9a8611063142541993e4823a025622 (patch)
tree8bb0e47325d65d75876c1ee7aad35666dc9d3f4e /test/irb
parent3c6e1a8cf911d312edeb9dfcc9153be68867ca4f (diff)
Incremental syntax highlight for IRB source lines
Closes: https://github.com/ruby/ruby/pull/2202
Diffstat (limited to 'test/irb')
-rw-r--r--test/irb/test_color.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/irb/test_color.rb b/test/irb/test_color.rb
index 3305c2414a..61b4ea48f2 100644
--- a/test/irb/test_color.rb
+++ b/test/irb/test_color.rb
@@ -32,6 +32,9 @@ module TestIRB
'"##@var]"' => "#{RED}\"#{CLEAR}#{RED}##{CLEAR}#{RED}##{CLEAR}@var#{RED}]#{CLEAR}#{RED}\"#{CLEAR}",
'"foo#{a} #{b}"' => "#{RED}\"#{CLEAR}#{RED}foo#{CLEAR}#{RED}\#{#{CLEAR}a#{RED}}#{CLEAR}#{RED} #{CLEAR}#{RED}\#{#{CLEAR}b#{RED}}#{CLEAR}#{RED}\"#{CLEAR}",
'/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\n#{CLEAR}#{RED}b#{CLEAR}#{RED}'#{CLEAR}",
+ "4.5.6" => "4.5.6",
+ "[1]]]" => "[1]]]",
}.each do |code, result|
assert_equal(result, with_term { IRB::Color.colorize_code(code) }, "Case: colorize_code(#{code.dump})")
end