summaryrefslogtreecommitdiff
path: root/test/reline/test_key_actor_emacs.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-06-06 04:25:16 +0900
committeraycabta <aycabta@gmail.com>2019-06-06 04:25:16 +0900
commiteadc06ba1664102da07ec08aeca6c3e1eccc4e96 (patch)
tree200b874ce76720ae291820db3a90eb6ba80c429a /test/reline/test_key_actor_emacs.rb
parent6dc0541ed3c3736fb4c0b270f2c8df1c0dbfba95 (diff)
Add test_ed_transpose_words_for_mbchar
Diffstat (limited to 'test/reline/test_key_actor_emacs.rb')
-rw-r--r--test/reline/test_key_actor_emacs.rb42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/reline/test_key_actor_emacs.rb b/test/reline/test_key_actor_emacs.rb
index d79627a8c2..4194659631 100644
--- a/test/reline/test_key_actor_emacs.rb
+++ b/test/reline/test_key_actor_emacs.rb
@@ -861,6 +861,48 @@ class Reline::KeyActor::Emacs::Test < Reline::TestCase
assert_cursor_max(12)
end
+ def test_ed_transpose_words_for_mbchar
+ input_keys('あいう かきく')
+ assert_line('あいう かきく')
+ assert_byte_pointer_size('あいう かきく')
+ assert_cursor(13)
+ assert_cursor_max(13)
+ input_keys("\M-t", false)
+ assert_line('かきく あいう')
+ assert_byte_pointer_size('かきく あいう')
+ assert_cursor(13)
+ assert_cursor_max(13)
+ input_keys("\C-a\C-k", false)
+ input_keys(' あいう かきく ')
+ input_keys("\C-b" * 4, false)
+ assert_line(' あいう かきく ')
+ assert_byte_pointer_size(' あいう かき')
+ assert_cursor(13)
+ assert_cursor_max(18)
+ input_keys("\M-t", false)
+ assert_line(' かきく あいう ')
+ assert_byte_pointer_size(' かきく あいう')
+ assert_cursor(15)
+ assert_cursor_max(18)
+ input_keys("\C-a\C-k", false)
+ input_keys(' あいう かきく ')
+ input_keys("\C-b" * 6, false)
+ assert_line(' あいう かきく ')
+ assert_byte_pointer_size(' あいう ')
+ assert_cursor(9)
+ assert_cursor_max(18)
+ input_keys("\M-t", false)
+ assert_line(' かきく あいう ')
+ assert_byte_pointer_size(' かきく あいう')
+ assert_cursor(15)
+ assert_cursor_max(18)
+ input_keys("\M-t", false)
+ assert_line(' あいう かきく')
+ assert_byte_pointer_size(' あいう かきく')
+ assert_cursor(18)
+ assert_cursor_max(18)
+ end
+
def test_ed_digit
input_keys('0123')
assert_byte_pointer_size('0123')