From f51ce20c6ad59eb8e274bde1780dae58020cb192 Mon Sep 17 00:00:00 2001 From: aycabta 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(-) (limited to 'test') diff --git a/test/reline/yamatanooroti/multiline_repl b/test/reline/yamatanooroti/multiline_repl index 1346a83adb..c944da8a38 100755 --- a/test/reline/yamatanooroti/multiline_repl +++ b/test/reline/yamatanooroti/multiline_repl @@ -74,19 +74,19 @@ opt.on('--dialog VAL') { |v| } 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 c147d1cf99..59fc5111aa 100644 --- a/test/reline/yamatanooroti/test_rendering.rb +++ b/test/reline/yamatanooroti/test_rendering.rb @@ -911,17 +911,13 @@ begin 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.2.3