ruby-changes:59531
From: aycabta <ko1@a...>
Date: Fri, 27 Dec 2019 16:33:33 +0900 (JST)
Subject: [ruby-changes:59531] 4db898284d (master): Add test_completion_with_indent_and_completer_quote_characters
https://git.ruby-lang.org/ruby.git/commit/?id=4db898284d From 4db898284db1f02829abf412ae4f584220a2bcba Mon Sep 17 00:00:00 2001 From: aycabta <aycabta@g...> Date: Fri, 27 Dec 2019 16:07:30 +0900 Subject: Add test_completion_with_indent_and_completer_quote_characters This is for 8a705245e55575d4d310a2e956b89a36a5931971. diff --git a/test/reline/test_key_actor_emacs.rb b/test/reline/test_key_actor_emacs.rb index 97ff654..120f514 100644 --- a/test/reline/test_key_actor_emacs.rb +++ b/test/reline/test_key_actor_emacs.rb @@ -1325,6 +1325,37 @@ class Reline::KeyActor::Emacs::Test < Reline::TestCase https://github.com/ruby/ruby/blob/trunk/test/reline/test_key_actor_emacs.rb#L1325 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{ -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/