Skip to content

Commit ee1c1ad

Browse files
committed
Fix complete proc of a script for tests
1 parent 6c2ab47 commit ee1c1ad

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

test/reline/yamatanooroti/multiline_repl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,19 @@ opt.on('--dialog VAL') { |v|
7474
}
7575
opt.on('--complete') {
7676
Reline.completion_proc = lambda { |target, preposing = nil, postposing = nil|
77-
%w{String ScriptError SyntaxError Signal}
77+
%w{String ScriptError SyntaxError Signal}.select{ |c| c.start_with?(target) }
7878
}
7979
}
8080
opt.on('--autocomplete') {
8181
Reline.autocompletion = true
8282
Reline.completion_proc = lambda { |target, preposing = nil, postposing = nil|
83-
%w{String Struct Symbol ScriptError SyntaxError Signal}
83+
%w{String Struct Symbol ScriptError SyntaxError Signal}.select{ |c| c.start_with?(target) }
8484
}
8585
}
8686
opt.on('--autocomplete-long') {
8787
Reline.autocompletion = true
8888
Reline.completion_proc = lambda { |target, preposing = nil, postposing = nil|
89-
%w{String Struct Symbol StopIteration SystemCallError SystemExit SystemStackError ScriptError SyntaxError Signal SizedQueue Set SecureRandom Socket StringIO StringScanner Shellwords Syslog Singleton SDBM}
89+
%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) }
9090
}
9191
}
9292
opt.parse!(ARGV)

test/reline/yamatanooroti/test_rendering.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -911,17 +911,13 @@ def test_simple_dialog_with_scroll_key
911911

912912
def test_autocomplete
913913
start_terminal(20, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --autocomplete}, startup_message: 'Multiline REPL.')
914-
write("Stri")
914+
write("Str")
915915
close
916916
assert_screen(<<~'EOC')
917917
Multiline REPL.
918-
prompt> Stri
918+
prompt> Str
919919
String
920920
Struct
921-
Symbol
922-
ScriptError
923-
SyntaxError
924-
Signal
925921
EOC
926922
end
927923

0 commit comments

Comments
 (0)