[前][次][番号順一覧][スレッド一覧]

ruby-changes:59190

From: aycabta <ko1@a...>
Date: Wed, 11 Dec 2019 19:56:37 +0900 (JST)
Subject: [ruby-changes:59190] c2f6aa4e48 (master): The result of Readline.completion_proc should have the same encoding of Encoding.default_external

https://git.ruby-lang.org/ruby.git/commit/?id=c2f6aa4e48

From c2f6aa4e4810f8f2aabc35bf4c98ee030ff504b9 Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Wed, 11 Dec 2019 19:39:37 +0900
Subject: The result of Readline.completion_proc should have the same encoding
 of Encoding.default_external


diff --git a/test/readline/test_readline.rb b/test/readline/test_readline.rb
index 60be910..a6e37c0 100644
--- a/test/readline/test_readline.rb
+++ b/test/readline/test_readline.rb
@@ -516,7 +516,9 @@ module BasetestReadline https://github.com/ruby/ruby/blob/trunk/test/readline/test_readline.rb#L516
       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 https://github.com/ruby/ruby/blob/trunk/test/readline/test_readline.rb#L556
       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 https://github.com/ruby/ruby/blob/trunk/test/readline/test_readline.rb#L584
 
   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 https://github.com/ruby/ruby/blob/trunk/test/readline/test_readline.rb#L592
         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 https://github.com/ruby/ruby/blob/trunk/test/readline/test_readline.rb#L617
         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
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]