Skip to content

Commit

Permalink
make sync-default-gems GEM=irb
Browse files Browse the repository at this point in the history
from ruby/irb@96f05e7.

Just syncing newer test changes so that conflicts do not happen when trunk is
modified and we need to backport that to ruby/irb.
  • Loading branch information
k0kubun committed Apr 28, 2019
1 parent 588f212 commit 8711f77
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions test/irb/test_color.rb
Expand Up @@ -31,13 +31,8 @@ def test_colorize_code
"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
Expand Down

0 comments on commit 8711f77

Please sign in to comment.