aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authortomoya ishida <tomoyapenguin@gmail.com>2023-03-27 22:54:05 +0900
committergit <svn-admin@ruby-lang.org>2023-03-27 13:57:16 +0000
commit8f569d41cba4379b8d50d24fdf8c43f43bc3f1b8 (patch)
treed5cc70250a3dc6f1fbbbf02911f667feefc5d54f /test
parenta2ff9423a1ecc4f2831a69f82a60f00c4a3f81a9 (diff)
downloadruby-8f569d41cba4379b8d50d24fdf8c43f43bc3f1b8.tar.gz
[ruby/reline] Fix cursor position overrun
(https://github.com/ruby/reline/pull/515) * Fix cursor position overrun * Remove unnecessary local variable Co-authored-by: Stan Lo <stan001212@gmail.com> --------- https://github.com/ruby/reline/commit/d4ad9b96c8 Co-authored-by: Stan Lo <stan001212@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/reline/yamatanooroti/test_rendering.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/reline/yamatanooroti/test_rendering.rb b/test/reline/yamatanooroti/test_rendering.rb
index e3ff83bab6..d34db1c14e 100644
--- a/test/reline/yamatanooroti/test_rendering.rb
+++ b/test/reline/yamatanooroti/test_rendering.rb
@@ -661,6 +661,30 @@ begin
EOC
end
+ def test_longer_than_screen_height_nearest_cursor_with_scroll_back
+ start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
+ write(<<~EOC.chomp)
+ if 1
+ if 2
+ if 3
+ if 4
+ puts
+ end
+ end
+ end
+ end
+ EOC
+ write("\C-p" * 4 + "\C-e" + "\C-p" * 4)
+ write("2")
+ assert_screen(<<~EOC)
+ prompt> if 12
+ prompt> if 2
+ prompt> if 3
+ prompt> if 4
+ prompt> puts
+ EOC
+ end
+
def test_update_cursor_correctly_when_just_cursor_moving
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
write("def hoge\n 01234678")