зеркало из https://github.com/github/ruby.git
[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:
Родитель
10e0ebc7c2
Коммит
f1e923631c
|
@ -939,6 +939,22 @@ class Reline::KeyActor::EmacsTest < Reline::TestCase
|
|||
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{
|
||||
|
|
Загрузка…
Ссылка в новой задаче