Skip to content

Commit

Permalink
Fix complete proc of a script for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Sep 9, 2021
1 parent 6c2ab47 commit ee1c1ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 3 additions & 3 deletions test/reline/yamatanooroti/multiline_repl
Expand Up @@ -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)
Expand Down
8 changes: 2 additions & 6 deletions test/reline/yamatanooroti/test_rendering.rb
Expand Up @@ -911,17 +911,13 @@ def test_simple_dialog_with_scroll_key

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

Expand Down

0 comments on commit ee1c1ad

Please sign in to comment.