mirror of
https://github.com/ruby/ruby.git
synced 2025-09-20 11:03:58 +02:00
Update expected IRB result
This commit is contained in:
parent
69d871eeeb
commit
1f7b557890
1 changed files with 11 additions and 1 deletions
|
@ -34,7 +34,6 @@ module TestIRB
|
||||||
'"foo#{a} #{b}"' => "#{RED}#{BOLD}\"#{CLEAR}#{RED}foo#{CLEAR}#{RED}\#{#{CLEAR}a#{RED}}#{CLEAR}#{RED} #{CLEAR}#{RED}\#{#{CLEAR}b#{RED}}#{CLEAR}#{RED}#{BOLD}\"#{CLEAR}",
|
'"foo#{a} #{b}"' => "#{RED}#{BOLD}\"#{CLEAR}#{RED}foo#{CLEAR}#{RED}\#{#{CLEAR}a#{RED}}#{CLEAR}#{RED} #{CLEAR}#{RED}\#{#{CLEAR}b#{RED}}#{CLEAR}#{RED}#{BOLD}\"#{CLEAR}",
|
||||||
'/r#{e}g/' => "#{RED}#{BOLD}/#{CLEAR}#{RED}r#{CLEAR}#{RED}\#{#{CLEAR}e#{RED}}#{CLEAR}#{RED}g#{CLEAR}#{RED}#{BOLD}/#{CLEAR}",
|
'/r#{e}g/' => "#{RED}#{BOLD}/#{CLEAR}#{RED}r#{CLEAR}#{RED}\#{#{CLEAR}e#{RED}}#{CLEAR}#{RED}g#{CLEAR}#{RED}#{BOLD}/#{CLEAR}",
|
||||||
"'a\nb'" => "#{RED}#{BOLD}'#{CLEAR}#{RED}a#{CLEAR}\n#{RED}b#{CLEAR}#{RED}#{BOLD}'#{CLEAR}",
|
"'a\nb'" => "#{RED}#{BOLD}'#{CLEAR}#{RED}a#{CLEAR}\n#{RED}b#{CLEAR}#{RED}#{BOLD}'#{CLEAR}",
|
||||||
"[1]]]\u0013" => "[1]]]^S",
|
|
||||||
"%[str]" => "#{RED}#{BOLD}%[#{CLEAR}#{RED}str#{CLEAR}#{RED}#{BOLD}]#{CLEAR}",
|
"%[str]" => "#{RED}#{BOLD}%[#{CLEAR}#{RED}str#{CLEAR}#{RED}#{BOLD}]#{CLEAR}",
|
||||||
"%Q[str]" => "#{RED}#{BOLD}%Q[#{CLEAR}#{RED}str#{CLEAR}#{RED}#{BOLD}]#{CLEAR}",
|
"%Q[str]" => "#{RED}#{BOLD}%Q[#{CLEAR}#{RED}str#{CLEAR}#{RED}#{BOLD}]#{CLEAR}",
|
||||||
"%q[str]" => "#{RED}#{BOLD}%q[#{CLEAR}#{RED}str#{CLEAR}#{RED}#{BOLD}]#{CLEAR}",
|
"%q[str]" => "#{RED}#{BOLD}%q[#{CLEAR}#{RED}str#{CLEAR}#{RED}#{BOLD}]#{CLEAR}",
|
||||||
|
@ -78,6 +77,17 @@ module TestIRB
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# specific to Ruby 3.0+
|
||||||
|
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.0.0')
|
||||||
|
tests.merge!({
|
||||||
|
"[1]]]\u0013" => "[#{BLUE}#{BOLD}1#{CLEAR}]#{RED}#{REVERSE}]#{CLEAR}#{RED}#{REVERSE}]#{CLEAR}#{RED}#{REVERSE}^S#{CLEAR}",
|
||||||
|
})
|
||||||
|
else
|
||||||
|
tests.merge!({
|
||||||
|
"[1]]]\u0013" => "[1]]]^S",
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
tests.each do |code, result|
|
tests.each do |code, result|
|
||||||
if colorize_code_supported?
|
if colorize_code_supported?
|
||||||
actual = with_term { IRB::Color.colorize_code(code, complete: true) }
|
actual = with_term { IRB::Color.colorize_code(code, complete: true) }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue