From fe276df84d269e6d40d2bca857c8ec8935ab107f Mon Sep 17 00:00:00 2001 From: tompng Date: Wed, 19 Jul 2023 06:06:21 +0900 Subject: [PATCH] Add rendering test for Ctrl-d exit --- test/reline/yamatanooroti/test_rendering.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/reline/yamatanooroti/test_rendering.rb b/test/reline/yamatanooroti/test_rendering.rb index 985884393a..c72e47fd38 100644 --- a/test/reline/yamatanooroti/test_rendering.rb +++ b/test/reline/yamatanooroti/test_rendering.rb @@ -1591,6 +1591,20 @@ def test_repeated_input_delete EOC end + def test_exit_with_ctrl_d + start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --auto-indent}, startup_message: 'Multiline REPL.') + begin + write("\C-d") + close + rescue EOFError + # EOFError is raised when process terminated. + end + assert_screen(<<~EOC) + Multiline REPL. + prompt> + EOC + end + def write_inputrc(content) File.open(@inputrc_file, 'w') do |f| f.write content