summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2020-02-23 12:35:24 +0900
committeraycabta <aycabta@gmail.com>2020-03-26 17:41:21 +0900
commitf245fb1ab8d893a89c8749a703efea0b16353028 (patch)
treebcdb35d97c228f6616a290284b7e492e4f8d4b2e /test
parent22477128cd77e0d0dce7e78bc12f9cc8cccc1cb4 (diff)
[ruby/reline] Work with wrong $/ value correctly
https://github.com/ruby/reline/commit/962ebf5a1b
Diffstat (limited to 'test')
-rw-r--r--test/reline/test_key_actor_emacs.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/reline/test_key_actor_emacs.rb b/test/reline/test_key_actor_emacs.rb
index 7e97caad23..c16212c626 100644
--- a/test/reline/test_key_actor_emacs.rb
+++ b/test/reline/test_key_actor_emacs.rb
@@ -1896,6 +1896,15 @@ class Reline::KeyActor::Emacs::Test < Reline::TestCase
assert_equal([0, 0], @line_editor.instance_variable_get(:@mark_pointer))
end
+ def test_modify_lines_with_wrong_rs
+ original_global_slash = $/
+ $/ = 'b'
+ @line_editor.output_modifier_proc = proc { |output| Reline::Unicode.escape_for_print(output) }
+ input_keys("abcdef\n")
+ assert_equal(['abcdef'], @line_editor.__send__(:modify_lines, @line_editor.whole_lines))
+ $/ = original_global_slash
+ end
+
=begin # TODO: move KeyStroke instance from Reline to LineEditor
def test_key_delete
input_keys('ab')