summaryrefslogtreecommitdiff
path: root/test/reline/yamatanooroti/multiline_repl
diff options
context:
space:
mode:
authortomoya ishida <tomoyapenguin@gmail.com>2023-01-18 14:28:13 +0900
committergit <svn-admin@ruby-lang.org>2023-01-18 05:28:18 +0000
commit2d7e63954956645a4a050c78df71c8f4a56851d8 (patch)
treef508ee98419b452c9d20de38b4cc60dbf5f8b0f7 /test/reline/yamatanooroti/multiline_repl
parent46066d0b96473589038810ac3aa19a1e26fdb837 (diff)
[ruby/reline] multiline_repl do not need to depend on RubyLex
(https://github.com/ruby/reline/pull/502) * multiline_repl do not need to depend on RubyLex * Add auto indent test
Diffstat (limited to 'test/reline/yamatanooroti/multiline_repl')
-rwxr-xr-xtest/reline/yamatanooroti/multiline_repl7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/reline/yamatanooroti/multiline_repl b/test/reline/yamatanooroti/multiline_repl
index c429494442..7e58b602eb 100755
--- a/test/reline/yamatanooroti/multiline_repl
+++ b/test/reline/yamatanooroti/multiline_repl
@@ -53,7 +53,9 @@ opt.on('--color-bold') {
}
}
opt.on('--auto-indent') {
- AutoIndent.new
+ Reline.auto_indent_proc = lambda do |lines, line_index, byte_pointer, is_newline|
+ AutoIndent.calculate_indent(lines, line_index, byte_pointer, is_newline)
+ end
}
opt.on('--dialog VAL') { |v|
Reline.add_dialog_proc(:simple_dialog, lambda {
@@ -194,8 +196,7 @@ end
begin
prompt = ENV['RELINE_TEST_PROMPT'] || 'prompt> '
puts 'Multiline REPL.'
- checker = TerminationChecker.new
- while code = Reline.readmultiline(prompt, true) { |code| checker.terminated?(code) }
+ while code = Reline.readmultiline(prompt, true) { |code| TerminationChecker.terminated?(code) }
case code.chomp
when 'exit', 'quit', 'q'
exit 0