aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/functional/job/job_spec.lua11
-rw-r--r--test/functional/ui/output_spec.lua39
2 files changed, 44 insertions, 6 deletions
diff --git a/test/functional/job/job_spec.lua b/test/functional/job/job_spec.lua
index b54d5166ac..7a314bcf9c 100644
--- a/test/functional/job/job_spec.lua
+++ b/test/functional/job/job_spec.lua
@@ -1,4 +1,3 @@
-
local helpers = require('test.functional.helpers')(after_each)
local clear, eq, eval, execute, feed, insert, neq, next_msg, nvim,
nvim_dir, ok, source, write_file, mkdir, rmdir = helpers.clear,
@@ -120,7 +119,7 @@ describe('jobs', function()
{0, {'a', '', 'c', '', '', '', 'b', '', ''}}}, next_msg())
end)
- it('can preserve nuls', function()
+ it('can preserve NULs', function()
nvim('command', "let j = jobstart(['cat', '-'], g:job_opts)")
nvim('command', 'call jobsend(j, ["\n123\n", "abc\\nxyz\n", ""])')
eq({'notification', 'stdout', {0, {'\n123\n', 'abc\nxyz\n', ''}}},
@@ -144,7 +143,7 @@ describe('jobs', function()
eq({'notification', 'exit', {0, 0}}, next_msg())
end)
- it("won't allow jobsend with a job that closed stdin", function()
+ it("disallows jobsend on a job that closed stdin", function()
nvim('command', "let j = jobstart(['cat', '-'], g:job_opts)")
nvim('command', 'call jobclose(j, "stdin")')
eq(false, pcall(function()
@@ -152,12 +151,12 @@ describe('jobs', function()
end))
end)
- it('will not allow jobsend/stop on a non-existent job', function()
+ it('disallows jobsend/stop on a non-existent job', function()
eq(false, pcall(eval, "jobsend(-1, 'lol')"))
eq(false, pcall(eval, "jobstop(-1)"))
end)
- it('will not allow jobstop twice on the same job', function()
+ it('disallows jobstop twice on the same job', function()
nvim('command', "let j = jobstart(['cat', '-'], g:job_opts)")
neq(0, eval('j'))
eq(true, pcall(eval, "jobstop(j)"))
@@ -244,7 +243,7 @@ describe('jobs', function()
eq({'notification', 'exit', {45, 10}}, next_msg())
end)
- it('cant redefine callbacks being used by a job', function()
+ it('cannot redefine callbacks being used by a job', function()
local screen = Screen.new()
screen:attach()
local script = [[
diff --git a/test/functional/ui/output_spec.lua b/test/functional/ui/output_spec.lua
new file mode 100644
index 0000000000..c7c8986527
--- /dev/null
+++ b/test/functional/ui/output_spec.lua
@@ -0,0 +1,39 @@
+local session = require('test.functional.helpers')(after_each)
+local child_session = require('test.functional.terminal.helpers')
+
+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: } |
+ ~ |
+ ~ |
+ ~ |
+ [No Name] |
+ |
+ -- TERMINAL -- |
+ ]])
+ end)
+
+ after_each(function()
+ 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([[
+ ~ |
+ ~ |
+ [No Name] |
+ :!printf foo; sleep 200 |
+ |
+ foo |
+ -- TERMINAL -- |
+ ]])
+ end)
+end)