From 98be203704e98c53b2d3b939b10a0d765c76d53d Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Sat, 25 May 2019 08:01:51 -0700 Subject: Support some unhandled syntax highlight Heredoc, %i, :Foo, { 'a': ... }, ... :'a' is still half-broken. --- test/irb/test_color.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/irb') diff --git a/test/irb/test_color.rb b/test/irb/test_color.rb index 1d7d74e151..95ed190dae 100644 --- a/test/irb/test_color.rb +++ b/test/irb/test_color.rb @@ -1,6 +1,7 @@ # frozen_string_literal: false require 'test/unit' require 'irb/color' +require 'rubygems' require 'stringio' module TestIRB @@ -36,6 +37,11 @@ module TestIRB "4.5.6" => "4.5.6", "[1]]]" => "[1]]]", "\e[0m\n" => "^[[#{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}", + "{'a': 1}" => "{#{RED}'#{CLEAR}#{RED}a#{CLEAR}#{RED}':#{CLEAR} #{BLUE}#{BOLD}1#{CLEAR}}", + ":Struct" => "#{BLUE}#{BOLD}:#{CLEAR}#{BLUE}#{BOLD}#{UNDERLINE}Struct#{CLEAR}", + "< "#{RED}<