Skip to content

Commit

Permalink
Add a test for full-width scrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Oct 9, 2021
1 parent 4afbc98 commit cff83e6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/reline/yamatanooroti/multiline_repl
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down
13 changes: 13 additions & 0 deletions test/reline/yamatanooroti/test_rendering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,19 @@ def test_dialog_narrower_than_screen_with_scrollbar
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')
Expand Down

0 comments on commit cff83e6

Please sign in to comment.