summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2021-10-09 23:07:18 +0900
committergit <svn-admin@ruby-lang.org>2021-10-09 23:23:07 +0900
commitbf1f6a696fbd96379d3d5b85afbe5639ecea2f14 (patch)
treec107b0815132d2d44ec7e48d583bfffe11c121be
parent9cb7ba2f21aac6356089de949ef59ca42974b24b (diff)
[ruby/reline] Add a test for full-width scrollbar
https://github.com/ruby/reline/commit/cff83e68f8
-rwxr-xr-xtest/reline/yamatanooroti/multiline_repl6
-rw-r--r--test/reline/yamatanooroti/test_rendering.rb13
2 files changed, 19 insertions, 0 deletions
diff --git a/test/reline/yamatanooroti/multiline_repl b/test/reline/yamatanooroti/multiline_repl
index b80d1b3ab2..2e826793fa 100755
--- a/test/reline/yamatanooroti/multiline_repl
+++ b/test/reline/yamatanooroti/multiline_repl
@@ -74,8 +74,14 @@ opt.on('--dialog VAL') { |v|
if v.include?('scrollbar')
scrollbar = true
end
+ if v.include?('alt-scrollbar')
+ scrollbar = true
+ end
Reline::DialogRenderInfo.new(pos: cursor_pos, contents: contents, height: height, scrollbar: scrollbar)
})
+ if v.include?('alt-scrollbar')
+ ENV['RELINE_ALT_SCROLLBAR'] = '1'
+ end
}
opt.on('--complete') {
Reline.completion_proc = lambda { |target, preposing = nil, postposing = nil|
diff --git a/test/reline/yamatanooroti/test_rendering.rb b/test/reline/yamatanooroti/test_rendering.rb
index 08a6171786..0bfa0df71b 100644
--- a/test/reline/yamatanooroti/test_rendering.rb
+++ b/test/reline/yamatanooroti/test_rendering.rb
@@ -1114,6 +1114,19 @@ begin
EOC
end
+ def test_dialog_with_fullwidth_scrollbar
+ start_terminal(20, 40, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --dialog simple,scrollkey,alt-scrollbar}, startup_message: 'Multiline REPL.')
+ close
+ assert_screen(<<~'EOC')
+ Multiline REPL.
+ prompt>
+ Ruby is... ::
+ A dynamic, open source programming ::
+ language with a focus on simplicity''
+ and productivity. It has an elegant
+ EOC
+ end
+
def test_rerender_argument_prompt_after_pasting
start_terminal(20, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
write('abcdef')