[ruby/reline] Add completion_append_character test
(https://github.com/ruby/reline/pull/773) https://github.com/ruby/reline/commit/5f5a0aa78c
This commit is contained in:
parent
10e0ebc7c2
commit
f1e923631c
@ -939,6 +939,22 @@ class Reline::KeyActor::EmacsTest < Reline::TestCase
|
|||||||
assert_line_around_cursor('foo', '')
|
assert_line_around_cursor('foo', '')
|
||||||
end
|
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
|
def test_completion_with_completion_ignore_case
|
||||||
@line_editor.completion_proc = proc { |word|
|
@line_editor.completion_proc = proc { |word|
|
||||||
%w{
|
%w{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user