summaryrefslogtreecommitdiff
path: root/test/reline/yamatanooroti
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2021-02-05 21:39:29 +0900
committeraycabta <aycabta@gmail.com>2021-02-07 05:12:19 +0900
commit300084a85475988ba7c22e335230f31ec415dfc5 (patch)
tree5d2cbaca03c94132a1482781b7c84943fec738c7 /test/reline/yamatanooroti
parentfee19da2305c2977985206b7db86917d0f7ac8db (diff)
[ruby/reline] Terminate correctly in the middle of lines higher than the screen
https://github.com/ruby/reline/commit/e1d9240ada
Diffstat (limited to 'test/reline/yamatanooroti')
-rw-r--r--test/reline/yamatanooroti/test_rendering.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/reline/yamatanooroti/test_rendering.rb b/test/reline/yamatanooroti/test_rendering.rb
index 22c9316429..0ccc331efd 100644
--- a/test/reline/yamatanooroti/test_rendering.rb
+++ b/test/reline/yamatanooroti/test_rendering.rb
@@ -692,6 +692,20 @@ begin
EOC
end
+ def test_terminate_in_the_middle_of_lines
+ start_terminal(5, 20, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl}, startup_message: 'Multiline REPL.')
+ write("def hoge\n 1\n 2\n 3\n 4\nend\n")
+ write("\C-p\C-p\C-p\C-e\n")
+ close
+ assert_screen(<<~EOC)
+ prompt> 3
+ prompt> 4
+ prompt> end
+ => :hoge
+ prompt>
+ EOC
+ end
+
private def write_inputrc(content)
File.open(@inputrc_file, 'w') do |f|
f.write content