Skip to content

Commit

Permalink
Add completion_append_character test (#773)
Browse files Browse the repository at this point in the history
  • Loading branch information
tompng authored Oct 25, 2024
1 parent e364416 commit 5f5a0aa
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/reline/test_key_actor_emacs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,22 @@ def test_continuous_completion_disabled_with_perfect_match
assert_line_around_cursor('foo', '')
end

def test_completion_append_character
@line_editor.completion_proc = proc { |word|
%w[foo_ foo_foo foo_bar].select { |s| s.start_with? word }
}
@line_editor.completion_append_character = 'X'
input_keys('f')
input_keys("\C-i", false)
assert_line_around_cursor('foo_', '')
input_keys('f')
input_keys("\C-i", false)
assert_line_around_cursor('foo_fooX', '')
input_keys(' foo_bar')
input_keys("\C-i", false)
assert_line_around_cursor('foo_fooX foo_barX', '')
end

def test_completion_with_completion_ignore_case
@line_editor.completion_proc = proc { |word|
%w{
Expand Down

0 comments on commit 5f5a0aa

Please sign in to comment.