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

ruby-changes:67684

From: aycabta <ko1@a...>
Date: Fri, 10 Sep 2021 09:05:28 +0900 (JST)
Subject: [ruby-changes:67684] f51ce20c6a (master): [ruby/reline] Fix complete proc of a script for tests

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

From f51ce20c6ad59eb8e274bde1780dae58020cb192 Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Fri, 10 Sep 2021 07:34:33 +0900
Subject: [ruby/reline] Fix complete proc of a script for tests

https://github.com/ruby/reline/commit/ee1c1adddc
---
 test/reline/yamatanooroti/multiline_repl    | 6 +++---
 test/reline/yamatanooroti/test_rendering.rb | 8 ++------
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/test/reline/yamatanooroti/multiline_repl b/test/reline/yamatanooroti/multiline_repl
index 1346a83..c944da8 100755
--- a/test/reline/yamatanooroti/multiline_repl
+++ b/test/reline/yamatanooroti/multiline_repl
@@ -74,19 +74,19 @@ opt.on('--dialog VAL') { |v| https://github.com/ruby/ruby/blob/trunk/test/reline/yamatanooroti/multiline_repl#L74
 }
 opt.on('--complete') {
   Reline.completion_proc = lambda { |target, preposing = nil, postposing = nil|
-    %w{String ScriptError SyntaxError Signal}
+    %w{String ScriptError SyntaxError Signal}.select{ |c| c.start_with?(target) }
   }
 }
 opt.on('--autocomplete') {
   Reline.autocompletion = true
   Reline.completion_proc = lambda { |target, preposing = nil, postposing = nil|
-    %w{String Struct Symbol ScriptError SyntaxError Signal}
+    %w{String Struct Symbol ScriptError SyntaxError Signal}.select{ |c| c.start_with?(target) }
   }
 }
 opt.on('--autocomplete-long') {
   Reline.autocompletion = true
   Reline.completion_proc = lambda { |target, preposing = nil, postposing = nil|
-    %w{String Struct Symbol StopIteration SystemCallError SystemExit SystemStackError ScriptError SyntaxError Signal SizedQueue Set SecureRandom Socket StringIO StringScanner Shellwords Syslog Singleton SDBM}
+    %w{String Struct Symbol StopIteration SystemCallError SystemExit SystemStackError ScriptError SyntaxError Signal SizedQueue Set SecureRandom Socket StringIO StringScanner Shellwords Syslog Singleton SDBM}.select{ |c| c.start_with?(target) }
   }
 }
 opt.parse!(ARGV)
diff --git a/test/reline/yamatanooroti/test_rendering.rb b/test/reline/yamatanooroti/test_rendering.rb
index c147d1c..59fc511 100644
--- a/test/reline/yamatanooroti/test_rendering.rb
+++ b/test/reline/yamatanooroti/test_rendering.rb
@@ -911,17 +911,13 @@ begin https://github.com/ruby/ruby/blob/trunk/test/reline/yamatanooroti/test_rendering.rb#L911
 
     def test_autocomplete
       start_terminal(20, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --autocomplete}, startup_message: 'Multiline REPL.')
-      write("Stri")
+      write("Str")
       close
       assert_screen(<<~'EOC')
         Multiline REPL.
-        prompt> Stri
+        prompt> Str
                 String
                 Struct
-                Symbol
-                ScriptError
-                SyntaxError
-                Signal
       EOC
     end
 
-- 
cgit v1.1


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

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