summaryrefslogtreecommitdiff
path: root/test/reline
diff options
context:
space:
mode:
authortomoya ishida <tomoyapenguin@gmail.com>2023-05-07 22:18:09 +0900
committergit <svn-admin@ruby-lang.org>2023-05-07 13:18:13 +0000
commit5eca327fc50bebb06c6af103d109a1fef0895605 (patch)
tree7183f994cef98b7b19317891142c552d119aa2a1 /test/reline
parent8b2884c0b51e4733c09ecbb388ca1b236bad738b (diff)
[ruby/reline] Fix dialog corrupts rendering by pushing up input line
too much (https://github.com/ruby/reline/pull/524) * Do not render dialog where it overflows screen * Dialog rendering should Scroll down only when needed * Refactor screen_y_range calculation Co-authored-by: Stan Lo <stan001212@gmail.com> --------- https://github.com/ruby/reline/commit/bc0e3d1310 Co-authored-by: Stan Lo <stan001212@gmail.com>
Diffstat (limited to 'test/reline')
-rw-r--r--test/reline/yamatanooroti/test_rendering.rb20
1 files changed, 17 insertions, 3 deletions
diff --git a/test/reline/yamatanooroti/test_rendering.rb b/test/reline/yamatanooroti/test_rendering.rb
index 49d8ed406e..fce8f7474e 100644
--- a/test/reline/yamatanooroti/test_rendering.rb
+++ b/test/reline/yamatanooroti/test_rendering.rb
@@ -957,6 +957,20 @@ begin
EOC
end
+ def test_simple_dialog_with_scroll_screen
+ start_terminal(5, 50, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --dialog simple}, startup_message: 'Multiline REPL.')
+ write("if 1\n 2\n 3\n 4\n 5\n 6")
+ write("\C-p\C-n\C-p\C-p\C-p#")
+ close
+ assert_screen(<<~'EOC')
+ prompt> 2
+ prompt> 3#
+ prompt> 4
+ prompt> 5
+ prompt> 6 Ruby is...
+ EOC
+ end
+
def test_autocomplete_at_bottom
start_terminal(15, 50, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --autocomplete}, startup_message: 'Multiline REPL.')
write('def hoge' + "\C-m" * 10 + "end\C-p ")
@@ -1360,12 +1374,12 @@ begin
prompt>
prompt>
prompt>
+ prompt> S
prompt> String
prompt> Struct
- prompt> Symbol
- prompt> enScriptError
+ prompt> enSymbol
+ ScriptError
SyntaxError
- Signal
EOC
end