diff options
Diffstat (limited to 'test/reline')
-rw-r--r-- | test/reline/test_key_actor_emacs.rb | 11 | ||||
-rw-r--r-- | test/reline/test_key_actor_vi.rb | 19 |
2 files changed, 29 insertions, 1 deletions
diff --git a/test/reline/test_key_actor_emacs.rb b/test/reline/test_key_actor_emacs.rb index 81bff17967..ffd066f80f 100644 --- a/test/reline/test_key_actor_emacs.rb +++ b/test/reline/test_key_actor_emacs.rb @@ -305,6 +305,17 @@ class Reline::KeyActor::Emacs::Test < Reline::TestCase assert_line('aABC012abcd') end + def test_ed_move_to_beg_with_blank + input_keys(' abc') + assert_byte_pointer_size(' abc') + assert_cursor(5) + assert_cursor_max(5) + input_keys("\C-a", false) + assert_byte_pointer_size('') + assert_cursor(0) + assert_cursor_max(5) + end + def test_ed_move_to_end input_keys('abd') assert_byte_pointer_size('abd') diff --git a/test/reline/test_key_actor_vi.rb b/test/reline/test_key_actor_vi.rb index f5ceda05a6..52362e5893 100644 --- a/test/reline/test_key_actor_vi.rb +++ b/test/reline/test_key_actor_vi.rb @@ -988,7 +988,7 @@ class Reline::KeyActor::ViInsert::Test < Reline::TestCase assert_line('abcde foo_bar_baz ABCDE') end - def test_ed_move_to_beg + def test_vi_first_print input_keys("abcde\C-[^") assert_byte_pointer_size('') assert_cursor(0) @@ -1005,6 +1005,23 @@ class Reline::KeyActor::ViInsert::Test < Reline::TestCase assert_cursor_max(17) end + def test_ed_move_to_beg + input_keys("abcde\C-[0") + assert_byte_pointer_size('') + assert_cursor(0) + assert_cursor_max(5) + input_keys("0\C-ki") + input_keys(" abcde\C-[0") + assert_byte_pointer_size('') + assert_cursor(0) + assert_cursor_max(6) + input_keys("0\C-ki") + input_keys(" abcde ABCDE \C-[0") + assert_byte_pointer_size('') + assert_cursor(0) + assert_cursor_max(17) + end + def test_vi_delete_meta input_keys("aaa bbb ccc ddd eee\C-[02w") assert_byte_pointer_size('aaa bbb ') |