diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2015-10-29 07:46:39 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2015-10-29 08:13:45 -0300 |
commit | 7e8b431d3f67e5b167bc238899521715e1b324d8 (patch) | |
tree | 3e5bd9ec81abde9f993b6708fe63434590852a9e /test/functional/terminal | |
parent | 7dae3ad24ddd4d36e6ebb6d873e285d06130da46 (diff) | |
download | rneovim-7e8b431d3f67e5b167bc238899521715e1b324d8.tar.gz rneovim-7e8b431d3f67e5b167bc238899521715e1b324d8.tar.bz2 rneovim-7e8b431d3f67e5b167bc238899521715e1b324d8.zip |
tui: Fix abort when stdout and stderr are not tty.
The abort came from using libuv tty handle on non-tty fd. Use uv_pipe_t in these
cases. Also add simple test for this case.
Diffstat (limited to 'test/functional/terminal')
-rw-r--r-- | test/functional/terminal/tui_spec.lua | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index d38bedcd4a..0c4b80fdd2 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -149,3 +149,27 @@ describe('tui', function() ]]) end) end) + +describe('tui with non-tty file descriptors', function() + before_each(helpers.clear) + + after_each(function() + os.remove('testF') -- ensure test file is removed + end) + + it('can handle pipes as stdout and stderr', function() + local screen = thelpers.screen_setup(0, '"'..helpers.nvim_prog..' -u NONE -i NONE --cmd \'set noswapfile\' --cmd \'normal iabc\' > /dev/null 2>&1 && cat testF && rm testF"') + screen:set_default_attr_ids({}) + screen:set_default_attr_ignore(true) + feed(':w testF\n:q\n') + screen:expect([[ + :w testF | + :q | + abc | + | + [Program exited, press any key to close] | + | + -- TERMINAL -- | + ]]) + end) +end) |