Skip to content

Commit

Permalink
Add rendering test for Ctrl-d exit
Browse files Browse the repository at this point in the history
  • Loading branch information
tompng committed Jul 19, 2023
1 parent 4e74fcf commit fe276df
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/reline/yamatanooroti/test_rendering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fe276df

Please sign in to comment.