2016-07-14 21:11:49 -05:00
|
|
|
local session = require('test.functional.helpers')(after_each)
|
|
|
|
local child_session = require('test.functional.terminal.helpers')
|
|
|
|
|
2016-08-15 18:42:12 -05:00
|
|
|
if session.pending_win32(pending) then return end
|
|
|
|
|
2016-07-14 21:11:49 -05:00
|
|
|
describe("shell command :!", function()
|
|
|
|
local screen
|
|
|
|
before_each(function()
|
|
|
|
session.clear()
|
|
|
|
screen = child_session.screen_setup(0, '["'..session.nvim_prog..
|
|
|
|
'", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile"]')
|
|
|
|
screen:expect([[
|
|
|
|
{1: } |
|
2016-08-09 10:01:56 -05:00
|
|
|
{4:~ }|
|
|
|
|
{4:~ }|
|
|
|
|
{4:~ }|
|
|
|
|
{5:[No Name] }|
|
2016-07-14 21:11:49 -05:00
|
|
|
|
|
2016-08-09 10:01:56 -05:00
|
|
|
{3:-- TERMINAL --} |
|
2016-07-14 21:11:49 -05:00
|
|
|
]])
|
|
|
|
end)
|
|
|
|
|
|
|
|
after_each(function()
|
2016-09-14 09:19:07 -05:00
|
|
|
child_session.feed_data("\3") -- Ctrl-C
|
2016-07-14 21:11:49 -05:00
|
|
|
screen:detach()
|
|
|
|
end)
|
|
|
|
|
|
|
|
it("displays output even without LF/EOF. #4646 #4569 #3772", function()
|
|
|
|
-- NOTE: We use a child nvim (within a :term buffer)
|
|
|
|
-- to avoid triggering a UI flush.
|
|
|
|
child_session.feed_data(":!printf foo; sleep 200\n")
|
|
|
|
screen:expect([[
|
2016-08-09 10:01:56 -05:00
|
|
|
{4:~ }|
|
|
|
|
{4:~ }|
|
|
|
|
{5:[No Name] }|
|
2016-09-14 19:59:09 -05:00
|
|
|
:!printf foo; sleep 200 |
|
2016-07-14 21:11:49 -05:00
|
|
|
|
|
2016-09-14 19:59:09 -05:00
|
|
|
foo |
|
2016-08-09 10:01:56 -05:00
|
|
|
{3:-- TERMINAL --} |
|
2016-07-14 21:11:49 -05:00
|
|
|
]])
|
|
|
|
end)
|
|
|
|
end)
|