diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2019-04-26 01:15:30 +0900 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2019-04-26 01:15:30 +0900 |
commit | 5fe99aefd39ce535f658aabd0ca6e2265348d314 (patch) | |
tree | 1a42321f0b58d292fbe92ebee778893120cd625c /test/irb | |
parent | e64bab5f779440ae920746ae5689a2af91de3604 (diff) | |
download | ruby-5fe99aefd39ce535f658aabd0ca6e2265348d314.tar.gz |
Support highlighting Regexp in inspect
Diffstat (limited to 'test/irb')
-rw-r--r-- | test/irb/test_color.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/irb/test_color.rb b/test/irb/test_color.rb index d5f9286e36..601b7a2d34 100644 --- a/test/irb/test_color.rb +++ b/test/irb/test_color.rb @@ -23,6 +23,7 @@ module TestIRB "def self.foo; bar; end" => "#{GREEN}def#{CLEAR} #{CYAN}#{BOLD}self#{CLEAR}.#{BLUE}#{BOLD}foo#{CLEAR}; bar; #{GREEN}end#{CLEAR}", 'ERB.new("a#{nil}b", trim_mode: "-")' => "#{BLUE}#{BOLD}#{UNDERLINE}ERB#{CLEAR}.new(#{RED}\"#{CLEAR}#{RED}a#{CLEAR}#{RED}\#{#{CLEAR}#{CYAN}#{BOLD}nil#{CLEAR}#{RED}}#{CLEAR}#{RED}b#{CLEAR}#{RED}\"#{CLEAR}, #{MAGENTA}trim_mode:#{CLEAR} #{RED}\"#{CLEAR}#{RED}-#{CLEAR}#{RED}\"#{CLEAR})", "# comment" => "#{BLUE}#{BOLD}# comment#{CLEAR}", + '/r#{e}g/' => "#{RED}#{BOLD}/#{CLEAR}#{RED}r#{CLEAR}#{RED}\#{#{CLEAR}e}#{RED}g#{CLEAR}#{RED}#{BOLD}/#{CLEAR}", }.each do |code, result| assert_equal(result, with_term { IRB::Color.colorize_code(code) }) end @@ -34,6 +35,7 @@ module TestIRB 2.3 => true, ['foo', :bar] => true, { a: 4 } => true, + /reg/ => true, Object.new => false, Struct.new(:a) => false, Struct.new(:a).new(1) => false, |