Skip to content

Commit 5f5a0aa

Browse files
authored
Add completion_append_character test (#773)
1 parent e364416 commit 5f5a0aa

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

test/reline/test_key_actor_emacs.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,22 @@ def test_continuous_completion_disabled_with_perfect_match
939939
assert_line_around_cursor('foo', '')
940940
end
941941

942+
def test_completion_append_character
943+
@line_editor.completion_proc = proc { |word|
944+
%w[foo_ foo_foo foo_bar].select { |s| s.start_with? word }
945+
}
946+
@line_editor.completion_append_character = 'X'
947+
input_keys('f')
948+
input_keys("\C-i", false)
949+
assert_line_around_cursor('foo_', '')
950+
input_keys('f')
951+
input_keys("\C-i", false)
952+
assert_line_around_cursor('foo_fooX', '')
953+
input_keys(' foo_bar')
954+
input_keys("\C-i", false)
955+
assert_line_around_cursor('foo_fooX foo_barX', '')
956+
end
957+
942958
def test_completion_with_completion_ignore_case
943959
@line_editor.completion_proc = proc { |word|
944960
%w{

0 commit comments

Comments
 (0)