mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parent
7983fb9658
commit
4475953378
2 changed files with 22 additions and 0 deletions
|
@ -35,6 +35,12 @@ opt.on('--complete') {
|
||||||
%w{String ScriptError SyntaxError Signal}
|
%w{String ScriptError SyntaxError Signal}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
opt.on('--autocomplete') {
|
||||||
|
Reline.autocompletion = true
|
||||||
|
Reline.completion_proc = lambda { |target, preposing = nil, postposing = nil|
|
||||||
|
%w{String Struct Symbol ScriptError SyntaxError Signal}
|
||||||
|
}
|
||||||
|
}
|
||||||
opt.parse!(ARGV)
|
opt.parse!(ARGV)
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
|
|
@ -835,6 +835,22 @@ begin
|
||||||
EOC
|
EOC
|
||||||
end
|
end
|
||||||
|
|
||||||
|
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")
|
||||||
|
close
|
||||||
|
assert_screen(<<~'EOC')
|
||||||
|
Multiline REPL.
|
||||||
|
prompt> Stri
|
||||||
|
String
|
||||||
|
Struct
|
||||||
|
Symbol
|
||||||
|
ScriptError
|
||||||
|
SyntaxError
|
||||||
|
Signal
|
||||||
|
EOC
|
||||||
|
end
|
||||||
|
|
||||||
def write_inputrc(content)
|
def write_inputrc(content)
|
||||||
File.open(@inputrc_file, 'w') do |f|
|
File.open(@inputrc_file, 'w') do |f|
|
||||||
f.write content
|
f.write content
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue