diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-07-16 01:14:05 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-07-16 03:34:59 -0400 |
commit | ff93c9bd9075b1369d4dcc8555d8c5444e3ff0f7 (patch) | |
tree | 1f3a5879f7e33347137295acf519f1b4f17e67dd | |
parent | 4d4c92535ab5249b8597e32f9f56d69c4e0c2e55 (diff) | |
download | rneovim-ff93c9bd9075b1369d4dcc8555d8c5444e3ff0f7.tar.gz rneovim-ff93c9bd9075b1369d4dcc8555d8c5444e3ff0f7.tar.bz2 rneovim-ff93c9bd9075b1369d4dcc8555d8c5444e3ff0f7.zip |
test: PTY descendants should not prevent exit.
-rw-r--r-- | test/functional/core/job_spec.lua (renamed from test/functional/job/job_spec.lua) | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/functional/job/job_spec.lua b/test/functional/core/job_spec.lua index 7a314bcf9c..61ecdd1835 100644 --- a/test/functional/job/job_spec.lua +++ b/test/functional/core/job_spec.lua @@ -466,3 +466,41 @@ describe('jobs', function() end) end) end) + +describe("pty process teardown", function() + local screen + before_each(function() + clear() + screen = Screen.new(30, 6) + screen:attach() + screen:expect([[ + ^ | + ~ | + ~ | + ~ | + ~ | + | + ]]) + end) + after_each(function() + screen:detach() + end) + + it("does not prevent/delay exit. #4798 #4900", function() + -- Use a nested nvim (in :term) to test without --headless. + execute(":terminal '"..helpers.nvim_prog + -- Use :term again in the _nested_ nvim to get a PTY process. + -- Use `sleep` to simulate a long-running child of the PTY. + .."' +terminal +'!(sleep 300 &)' +qa") + + -- Exiting should terminate all descendants (PTY, its children, ...). + screen:expect([[ + | + [Process exited 0] | + | + | + | + -- TERMINAL -- | + ]]) + end) +end) |