1
0
Fork 0
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:
aycabta 2019-12-27 16:07:30 +09:00
parent 778634f778
commit 4db898284d

View file

@ -1325,6 +1325,37 @@ class Reline::KeyActor::Emacs::Test < Reline::TestCase
assert_line('foo_ba')
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
@line_editor.completion_proc = proc { |word|
%w{