summaryrefslogtreecommitdiff
path: root/test/reline/yamatanooroti/multiline_repl
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2021-12-24 20:07:55 +0900
committergit <svn-admin@ruby-lang.org>2021-12-25 00:32:58 +0900
commitc815c0be46b83c1c5c50a88cd1452635208fbee4 (patch)
tree4b01a6bb92732274e7dcc2b5f779dbf57370263f /test/reline/yamatanooroti/multiline_repl
parentb0db420b0e70753986d42579439acdd7ff0d9e95 (diff)
[ruby/reline] Escape newline(s) in dynamic prompt
https://github.com/ruby/reline/commit/9b209ee1ea
Diffstat (limited to 'test/reline/yamatanooroti/multiline_repl')
-rwxr-xr-xtest/reline/yamatanooroti/multiline_repl8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/reline/yamatanooroti/multiline_repl b/test/reline/yamatanooroti/multiline_repl
index 1f2a023724..3c47184b8e 100755
--- a/test/reline/yamatanooroti/multiline_repl
+++ b/test/reline/yamatanooroti/multiline_repl
@@ -27,6 +27,14 @@ opt.on('--broken-dynamic-prompt') {
opt.on('--dynamic-prompt-returns-empty') {
Reline.prompt_proc = proc { |l| [] }
}
+opt.on('--dynamic-prompt-with-newline') {
+ Reline.prompt_proc = proc { |lines|
+ range = lines.size > 1 ? (0..(lines.size - 2)) : (0..0)
+ lines[range].each_with_index.map { |l, i|
+ '[%04d\n]> ' % i
+ }
+ }
+}
opt.on('--auto-indent') {
AutoIndent.new
}