aboutsummaryrefslogtreecommitdiff
path: root/test/functional/job/job_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/job/job_spec.lua')
-rw-r--r--test/functional/job/job_spec.lua18
1 files changed, 8 insertions, 10 deletions
diff --git a/test/functional/job/job_spec.lua b/test/functional/job/job_spec.lua
index 1ba858251c..7085d61cc7 100644
--- a/test/functional/job/job_spec.lua
+++ b/test/functional/job/job_spec.lua
@@ -1,11 +1,11 @@
local helpers = require('test.functional.helpers')
-local clear, nvim, eq, neq, ok, expect, eval, next_msg, run, stop, session
- = helpers.clear, helpers.nvim, helpers.eq, helpers.neq, helpers.ok,
- helpers.expect, helpers.eval, helpers.next_message, helpers.run,
- helpers.stop, helpers.session
-local nvim_dir, insert, feed = helpers.nvim_dir, helpers.insert, helpers.feed
-local source, execute, wait = helpers.source, helpers.execute, helpers.wait
+local clear, eq, eval, execute, expect, feed, insert, neq, next_msg, nvim,
+ nvim_dir, ok, run, session, source, stop, wait, write_file = helpers.clear,
+ helpers.eq, helpers.eval, helpers.execute, helpers.expect, helpers.feed,
+ helpers.insert, helpers.neq, helpers.next_message, helpers.nvim,
+ helpers.nvim_dir, helpers.ok, helpers.run, helpers.session, helpers.source,
+ helpers.stop, helpers.wait, helpers.write_file
describe('jobs', function()
@@ -64,9 +64,7 @@ describe('jobs', function()
it('preserves NULs', function()
-- Make a file with NULs in it.
local filename = os.tmpname()
- local file = io.open(filename, "w")
- file:write("abc\0def\n")
- file:close()
+ write_file(filename, "abc\0def\n")
nvim('command', "let j = jobstart(['cat', '"..filename.."'], g:job_opts)")
eq({'notification', 'stdout', {0, {'abc\ndef', ''}}}, next_msg())
@@ -306,7 +304,7 @@ describe('jobs', function()
source([[
call rpcnotify(g:channel, 'wait', jobwait([
\ jobstart([&sh, '-c', 'exit 4']),
- \ jobstart([&sh, '-c', 'sleep 10000; exit 5']),
+ \ jobstart([&sh, '-c', 'sleep 10; exit 5']),
\ ], 100))
]])
eq({'notification', 'wait', {{4, -1}}}, next_msg())