From e9f82585eed414ff090d9ef7b667d0f3c1561a01 Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Thu, 8 Aug 2019 18:38:40 -0400 Subject: Don't crash when deleting at the end of the line To reproduce this bug, type one character into irb, then press the delete key on your keyboard. --- test/reline/test_key_actor_emacs.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/reline') diff --git a/test/reline/test_key_actor_emacs.rb b/test/reline/test_key_actor_emacs.rb index 7dd81caaf0..5c5e74f5c8 100644 --- a/test/reline/test_key_actor_emacs.rb +++ b/test/reline/test_key_actor_emacs.rb @@ -443,6 +443,16 @@ class Reline::KeyActor::Emacs::Test < Reline::TestCase assert_line('abc') end + def test_ed_delete_next_char + input_keys('abc') + assert_cursor(3) + assert_cursor_max(3) + @line_editor.input_key(Reline::Key.new(:key_delete, :key_delete, false)) + assert_cursor(3) + assert_cursor_max(3) + assert_line('abc') + end + def test_em_next_word assert_byte_pointer_size('') assert_cursor(0) -- cgit v1.2.3