summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2021-09-28 19:21:31 +0900
committergit <svn-admin@ruby-lang.org>2021-09-29 22:07:49 +0900
commit5eb8b6d1bd1b711a47541de41a2747af82cb0aea (patch)
tree463a2f5e0489f28857c33db904cbcb1f817f24f4 /test
parent0182bf615a6ef3fb0401a31b4f6840221af00db7 (diff)
[ruby/reline] Support ed_argument_digit by M+num
The vi mode can handle "argument number" before an operator or a motion, such as, "3x" (equals "xxx"), and "3l" (equals "lll"). In the emacs mode, GNU Readline can handle argument number with meta key, like "Meta+3 x" (equals "xxx"). https://github.com/ruby/reline/commit/9183cc2e8b
Diffstat (limited to 'test')
-rw-r--r--test/reline/test_key_actor_emacs.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/reline/test_key_actor_emacs.rb b/test/reline/test_key_actor_emacs.rb
index dd9b8bd812..8053225d24 100644
--- a/test/reline/test_key_actor_emacs.rb
+++ b/test/reline/test_key_actor_emacs.rb
@@ -2292,6 +2292,20 @@ class Reline::KeyActor::Emacs::Test < Reline::TestCase
assert_cursor_max(2)
end
+ def test_ed_argument_digit_by_meta_num
+ input_keys('abcdef')
+ assert_byte_pointer_size('abcdef')
+ assert_cursor(6)
+ assert_cursor_max(6)
+ assert_line('abcdef')
+ input_keys("\M-2", false)
+ input_keys("\C-h", false)
+ assert_byte_pointer_size('abcd')
+ assert_cursor(4)
+ assert_cursor_max(4)
+ assert_line('abcd')
+ end
+
def test_input_unknown_char
input_keys('͸') # U+0378 (unassigned)
assert_line('͸')