summaryrefslogtreecommitdiff
path: root/test/reline/test_key_actor_vi.rb
diff options
context:
space:
mode:
authortomoya ishida <[email protected]>2024-06-18 23:57:15 +0900
committergit <[email protected]>2024-06-18 14:57:19 +0000
commitc2e2c5975d576076bb3e77524d5458d28e761742 (patch)
tree62d5bb90237fd398e018a2e1409a36440b8af004 /test/reline/test_key_actor_vi.rb
parentb499356307139e80a414d9ddb3a7f14dadf0eda4 (diff)
[ruby/reline] Fix vi_yank or vi_delete_meta copies nil bug
(https://github.com/ruby/reline/pull/726) https://github.com/ruby/reline/commit/46b30b07c9
Diffstat (limited to 'test/reline/test_key_actor_vi.rb')
-rw-r--r--test/reline/test_key_actor_vi.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/reline/test_key_actor_vi.rb b/test/reline/test_key_actor_vi.rb
index 1288b9aaa5..07ca873ce3 100644
--- a/test/reline/test_key_actor_vi.rb
+++ b/test/reline/test_key_actor_vi.rb
@@ -738,6 +738,13 @@ class Reline::ViInsertTest < Reline::TestCase
assert_line_around_cursor('aaa ', 'ddd eee')
end
+ def test_vi_delete_meta_nothing
+ input_keys("foo\C-[0")
+ assert_line_around_cursor('', 'foo')
+ input_keys('dhp')
+ assert_line_around_cursor('', 'foo')
+ end
+
def test_vi_delete_meta_with_vi_next_word_at_eol
input_keys("foo bar\C-[0w")
assert_line_around_cursor('foo ', 'bar')
@@ -848,6 +855,13 @@ class Reline::ViInsertTest < Reline::TestCase
assert_line_around_cursor('foofofoofoo barba', 'ro barbar')
end
+ def test_vi_yank_nothing
+ input_keys("foo\C-[0")
+ assert_line_around_cursor('', 'foo')
+ input_keys('yhp')
+ assert_line_around_cursor('', 'foo')
+ end
+
def test_vi_end_word_with_operator
input_keys("foo bar\C-[0")
assert_line_around_cursor('', 'foo bar')