[ruby/irb] Fix error_message for assert_dynamic_prompt
https://github.com/ruby/irb/commit/b12dfb6298
This commit is contained in:
parent
31bd172185
commit
129ecb43e5
@ -281,8 +281,14 @@ module TestIRB
|
|||||||
skip if RUBY_ENGINE == 'truffleruby'
|
skip if RUBY_ENGINE == 'truffleruby'
|
||||||
ruby_lex = RubyLex.new()
|
ruby_lex = RubyLex.new()
|
||||||
io = MockIO_DynamicPrompt.new(lines) do |prompt_list|
|
io = MockIO_DynamicPrompt.new(lines) do |prompt_list|
|
||||||
error_message = "Calculated the wrong number of spaces for:\n #{lines.join("\n")}"
|
error_message = <<~EOM
|
||||||
assert_equal(expected_prompt_list, prompt_list)
|
Expected dynamic prompt:
|
||||||
|
#{expected_prompt_list.join("\n")}
|
||||||
|
|
||||||
|
Actual dynamic prompt:
|
||||||
|
#{prompt_list.join("\n")}
|
||||||
|
EOM
|
||||||
|
assert_equal(expected_prompt_list, prompt_list, error_message)
|
||||||
end
|
end
|
||||||
ruby_lex.set_prompt do |ltype, indent, continue, line_no|
|
ruby_lex.set_prompt do |ltype, indent, continue, line_no|
|
||||||
'%03d:%01d:%1s:%s ' % [line_no, indent, ltype, continue ? '*' : '>']
|
'%03d:%01d:%1s:%s ' % [line_no, indent, ltype, continue ? '*' : '>']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user