summaryrefslogtreecommitdiff
path: root/test/reline/yamatanooroti/test_rendering.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2022-01-12 19:46:33 +0900
committergit <svn-admin@ruby-lang.org>2022-01-16 22:09:31 +0900
commit921ff739df14c705491d75435c5e5ce31e2ed553 (patch)
treec57d34da85479720c32ff301f0df48c917c12d9d /test/reline/yamatanooroti/test_rendering.rb
parentd1e078e71c7a1dcd20c372d4a50b81ea647311e4 (diff)
[ruby/reline] Insert newline in the middle of buffer just after dialog
https://github.com/ruby/reline/commit/0c76631132
Diffstat (limited to 'test/reline/yamatanooroti/test_rendering.rb')
-rw-r--r--test/reline/yamatanooroti/test_rendering.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/reline/yamatanooroti/test_rendering.rb b/test/reline/yamatanooroti/test_rendering.rb
index 60d177d896..4da61c2041 100644
--- a/test/reline/yamatanooroti/test_rendering.rb
+++ b/test/reline/yamatanooroti/test_rendering.rb
@@ -1289,6 +1289,27 @@ begin
EOC
end
+ def test_insert_newline_in_the_middle_of_buffer_just_after_dialog
+ start_terminal(10, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --autocomplete}, startup_message: 'Multiline REPL.')
+ write("class A\n def a\n 3\n end\nend")
+ write("\n")
+ write("\C-p\C-p\C-p\C-p\C-p\C-e\C-hS")
+ write("\M-\x0D")
+ write(" 3")
+ close
+ assert_screen(<<~'EOC')
+ prompt> end
+ prompt> end
+ => :a
+ prompt> class S
+ prompt> 3
+ prompt> def a
+ prompt> 3
+ prompt> end
+ prompt> end
+ EOC
+ end
+
def write_inputrc(content)
File.open(@inputrc_file, 'w') do |f|
f.write content