summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/reline/helper.rb2
-rw-r--r--test/reline/yamatanooroti/test_rendering.rb15
2 files changed, 16 insertions, 1 deletions
diff --git a/test/reline/helper.rb b/test/reline/helper.rb
index f2f3421ded..26fe834482 100644
--- a/test/reline/helper.rb
+++ b/test/reline/helper.rb
@@ -131,7 +131,7 @@ class Reline::TestCase < Test::Unit::TestCase
def assert_line_around_cursor(before, after)
before = convert_str(before)
after = convert_str(after)
- line = @line_editor.line
+ line = @line_editor.current_line
byte_pointer = @line_editor.instance_variable_get(:@byte_pointer)
actual_before = line.byteslice(0, byte_pointer)
actual_after = line.byteslice(byte_pointer..)
diff --git a/test/reline/yamatanooroti/test_rendering.rb b/test/reline/yamatanooroti/test_rendering.rb
index fe0f8842ea..09d064934a 100644
--- a/test/reline/yamatanooroti/test_rendering.rb
+++ b/test/reline/yamatanooroti/test_rendering.rb
@@ -309,6 +309,21 @@ begin
EOC
end
+ def test_readline_with_multiline_input
+ start_terminal(5, 50, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --dynamic-prompt}, startup_message: 'Multiline REPL.')
+ write("def foo\n bar\nend\n")
+ write("Reline.readline('prompt> ')\n")
+ write("\C-p\C-p")
+ close
+ assert_screen(<<~EOC)
+ => :foo
+ [0000]> Reline.readline('prompt> ')
+ prompt> def foo
+ bar
+ end
+ EOC
+ end
+
def test_multiline_and_autowrap
start_terminal(10, 20, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
write("def aaaaaaaaaa\n 33333333\n end\C-a\C-pputs\C-e\e\C-m888888888888888")