summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2021-09-10 07:34:33 +0900
committergit <svn-admin@ruby-lang.org>2021-09-10 09:05:14 +0900
commitf51ce20c6ad59eb8e274bde1780dae58020cb192 (patch)
treefb57d2dbb5b15d4eba07605cf8fda12d9c6d5b96 /test
parent963e2c33b66c6fabcbcce2acbf280be9e3ccb2e8 (diff)
[ruby/reline] Fix complete proc of a script for tests
https://github.com/ruby/reline/commit/ee1c1adddc
Diffstat (limited to 'test')
-rwxr-xr-xtest/reline/yamatanooroti/multiline_repl6
-rw-r--r--test/reline/yamatanooroti/test_rendering.rb8
2 files changed, 5 insertions, 9 deletions
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