Skip to content

Commit f4eac8c

Browse files
committed
Suppress $/ warnings
1 parent 5e6033b commit f4eac8c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/reline/test_key_actor_emacs.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1897,12 +1897,19 @@ def test_em_set_mark_and_em_exchange_mark
18971897
end
18981898

18991899
def test_modify_lines_with_wrong_rs
1900+
verbose, $VERBOSE = $VERBOSE, nil
19001901
original_global_slash = $/
19011902
$/ = 'b'
1903+
$VERBOSE = verbose
19021904
@line_editor.output_modifier_proc = proc { |output| Reline::Unicode.escape_for_print(output) }
19031905
input_keys("abcdef\n")
1904-
assert_equal(['abcdef'], @line_editor.__send__(:modify_lines, @line_editor.whole_lines))
1906+
result = @line_editor.__send__(:modify_lines, @line_editor.whole_lines)
1907+
$/ = nil
1908+
assert_equal(['abcdef'], result)
1909+
ensure
1910+
$VERBOSE = nil
19051911
$/ = original_global_slash
1912+
$VERBOSE = verbose
19061913
end
19071914

19081915
=begin # TODO: move KeyStroke instance from Reline to LineEditor

0 commit comments

Comments
 (0)