mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Add test_completion_with_indent_and_completer_quote_characters
This is for 8a705245e5
.
This commit is contained in:
parent
778634f778
commit
4db898284d
1 changed files with 31 additions and 0 deletions
|
@ -1325,6 +1325,37 @@ class Reline::KeyActor::Emacs::Test < Reline::TestCase
|
||||||
assert_line('foo_ba')
|
assert_line('foo_ba')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_completion_with_indent_and_completer_quote_characters
|
||||||
|
@line_editor.completion_proc = proc { |word|
|
||||||
|
%w{
|
||||||
|
"".foo_foo
|
||||||
|
"".foo_bar
|
||||||
|
"".foo_baz
|
||||||
|
"".qux
|
||||||
|
}.map { |i|
|
||||||
|
i.encode(@encoding)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
input_keys(' "".foo_')
|
||||||
|
assert_byte_pointer_size(' "".foo_')
|
||||||
|
assert_cursor(9)
|
||||||
|
assert_cursor_max(9)
|
||||||
|
assert_line(' "".foo_')
|
||||||
|
assert_equal(nil, @line_editor.instance_variable_get(:@menu_info))
|
||||||
|
input_keys("\C-i", false)
|
||||||
|
assert_byte_pointer_size(' "".foo_')
|
||||||
|
assert_cursor(9)
|
||||||
|
assert_cursor_max(9)
|
||||||
|
assert_line(' "".foo_')
|
||||||
|
assert_equal(nil, @line_editor.instance_variable_get(:@menu_info))
|
||||||
|
input_keys("\C-i", false)
|
||||||
|
assert_byte_pointer_size(' "".foo_')
|
||||||
|
assert_cursor(9)
|
||||||
|
assert_cursor_max(9)
|
||||||
|
assert_line(' "".foo_')
|
||||||
|
assert_equal(%w{"".foo_foo "".foo_bar "".foo_baz}, @line_editor.instance_variable_get(:@menu_info).list)
|
||||||
|
end
|
||||||
|
|
||||||
def test_completion_with_perfect_match
|
def test_completion_with_perfect_match
|
||||||
@line_editor.completion_proc = proc { |word|
|
@line_editor.completion_proc = proc { |word|
|
||||||
%w{
|
%w{
|
||||||
|
|
Loading…
Add table
Reference in a new issue