summaryrefslogtreecommitdiff
path: root/test/irb
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2019-04-28 20:33:12 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-04-28 20:34:11 +0900
commit8711f77a26078b80eb954e0bc873418cf733eff5 (patch)
tree5f00e30bcf3221fa53020a6d5a4a38b6ba471ea9 /test/irb
parent588f212c2665555f76c68e0954332619bff60418 (diff)
make sync-default-gems GEM=irb
from https://github.com/ruby/irb/commit/96f05e726879e9858eb015c8d043c9f52b864ff9. Just syncing newer test changes so that conflicts do not happen when trunk is modified and we need to backport that to ruby/irb.
Diffstat (limited to 'test/irb')
-rw-r--r--test/irb/test_color.rb9
1 files changed, 2 insertions, 7 deletions
diff --git a/test/irb/test_color.rb b/test/irb/test_color.rb
index 5a2044836a..e6186efed2 100644
--- a/test/irb/test_color.rb
+++ b/test/irb/test_color.rb
@@ -31,13 +31,8 @@ module TestIRB
"yield(hello)" => "#{GREEN}yield#{CLEAR}(hello)",
'"##@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}",
- }.merge!(
- if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6.0')
- { '/r#{e}g/' => "#{RED}\e[1m/#{CLEAR}#{RED}r#{CLEAR}#{RED}\#{#{CLEAR}e#{RED}}#{CLEAR}#{RED}g#{CLEAR}#{RED}\e[1m/#{CLEAR}" }
- else
- { '/r#{e}g/' => "#{RED}#{BOLD}/#{CLEAR}#{RED}r#{CLEAR}#{RED}\#{#{CLEAR}e#{RED}}#{CLEAR}#{RED}g#{CLEAR}#{RED}#{BOLD}/#{CLEAR}" }
- end
- ).each do |code, result|
+ '/r#{e}g/' => "#{RED}#{BOLD}/#{CLEAR}#{RED}r#{CLEAR}#{RED}\#{#{CLEAR}e#{RED}}#{CLEAR}#{RED}g#{CLEAR}#{RED}#{BOLD}/#{CLEAR}",
+ }.each do |code, result|
assert_equal(result, with_term { IRB::Color.colorize_code(code) }, "Case: colorize_code(#{code.dump})")
end
end