1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

The result of Readline.completion_proc should have the same encoding of Encoding.default_external

This commit is contained in:
aycabta 2019-12-11 19:39:37 +09:00
parent 3098798044
commit c2f6aa4e48

View file

@ -516,7 +516,9 @@ module BasetestReadline
replace_stdio(stdin.path, stdout.path) do
Readline.completion_proc = ->(text) do
passed_text = text
['completion']
['completion'].map { |i|
i.encode(Encoding.default_external)
}
end
Readline.completer_quote_characters = '\'"'
Readline.completer_word_break_characters = ' '
@ -554,7 +556,9 @@ module BasetestReadline
replace_stdio(stdin.path, stdout.path) do
Readline.completion_proc = ->(text) do
passed_text = text
['completion']
['completion'].map { |i|
i.encode(Encoding.default_external)
}
end
Readline.completer_quote_characters = '\'"'
Readline.completer_word_break_characters = ' '
@ -580,7 +584,6 @@ module BasetestReadline
def test_simple_completion
skip "Skip Editline" if /EditLine/n.match(Readline::VERSION)
skip if /mingw/ =~ RUBY_DESCRIPTION # TODO: skip continuous failure.
line = nil
@ -589,7 +592,9 @@ module BasetestReadline
Readline.input = r
Readline.output = null
Readline.completion_proc = ->(text) do
['abcde', 'abc12']
['abcde', 'abc12'].map { |i|
i.encode(Encoding.default_external)
}
end
w.write("a\t\n")
w.flush
@ -612,7 +617,9 @@ module BasetestReadline
Readline.output = null
Readline.completion_append_character = '!'
Readline.completion_proc = ->(text) do
['abcde']
['abcde'].map { |i|
i.encode(Encoding.default_external)
}
end
w.write("a\t\n")
w.flush