summaryrefslogtreecommitdiff
path: root/test/reline/yamatanooroti
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2021-09-10 08:24:37 +0900
committergit <svn-admin@ruby-lang.org>2021-09-10 09:06:29 +0900
commita22c04a1d900746761da93e5051a6b22571b94cc (patch)
tree72c3fba31b9998c39882ec1345b151bcf731fdac /test/reline/yamatanooroti
parentd1498f93ab0ef48f8cf8f6ec718317dab6cd11b6 (diff)
[ruby/reline] Add a test that autocomplete doesn't crash after 2nd line
https://github.com/ruby/reline/commit/f682c74975
Diffstat (limited to 'test/reline/yamatanooroti')
-rw-r--r--test/reline/yamatanooroti/test_rendering.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/reline/yamatanooroti/test_rendering.rb b/test/reline/yamatanooroti/test_rendering.rb
index 285a10c23b..b29a34e367 100644
--- a/test/reline/yamatanooroti/test_rendering.rb
+++ b/test/reline/yamatanooroti/test_rendering.rb
@@ -961,6 +961,19 @@ begin
EOC
end
+ def test_autocomplete_after_2nd_line
+ start_terminal(20, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --autocomplete}, startup_message: 'Multiline REPL.')
+ write("def hoge\n Str")
+ close
+ assert_screen(<<~'EOC')
+ Multiline REPL.
+ prompt> def hoge
+ prompt> Str
+ String
+ Struct
+ EOC
+ end
+
def test_autocomplete_long_with_scrollbar
start_terminal(20, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --autocomplete-long}, startup_message: 'Multiline REPL.')
write('S')