mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parent
16c90f0678
commit
3486a460ea
1 changed files with 8 additions and 1 deletions
|
@ -1897,12 +1897,19 @@ class Reline::KeyActor::Emacs::Test < Reline::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_modify_lines_with_wrong_rs
|
def test_modify_lines_with_wrong_rs
|
||||||
|
verbose, $VERBOSE = $VERBOSE, nil
|
||||||
original_global_slash = $/
|
original_global_slash = $/
|
||||||
$/ = 'b'
|
$/ = 'b'
|
||||||
|
$VERBOSE = verbose
|
||||||
@line_editor.output_modifier_proc = proc { |output| Reline::Unicode.escape_for_print(output) }
|
@line_editor.output_modifier_proc = proc { |output| Reline::Unicode.escape_for_print(output) }
|
||||||
input_keys("abcdef\n")
|
input_keys("abcdef\n")
|
||||||
assert_equal(['abcdef'], @line_editor.__send__(:modify_lines, @line_editor.whole_lines))
|
result = @line_editor.__send__(:modify_lines, @line_editor.whole_lines)
|
||||||
|
$/ = nil
|
||||||
|
assert_equal(['abcdef'], result)
|
||||||
|
ensure
|
||||||
|
$VERBOSE = nil
|
||||||
$/ = original_global_slash
|
$/ = original_global_slash
|
||||||
|
$VERBOSE = verbose
|
||||||
end
|
end
|
||||||
|
|
||||||
=begin # TODO: move KeyStroke instance from Reline to LineEditor
|
=begin # TODO: move KeyStroke instance from Reline to LineEditor
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue