aboutsummaryrefslogtreecommitdiff
path: root/test/functional/helpers.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-09-01 11:13:29 -0700
committerGitHub <noreply@github.com>2019-09-01 11:13:29 -0700
commit2f37c243482eec20fe52f298368c02eca21c758f (patch)
treee58f19e64682ee8de1de7c514025adc9e747ef4c /test/functional/helpers.lua
parent78a2bbaa4b0ee6b0e575c4239b7b35eb42852910 (diff)
parent2c1749ce443c3bb15a719c947b186301bc8ef0b3 (diff)
downloadrneovim-2f37c243482eec20fe52f298368c02eca21c758f.tar.gz
rneovim-2f37c243482eec20fe52f298368c02eca21c758f.tar.bz2
rneovim-2f37c243482eec20fe52f298368c02eca21c758f.zip
Merge #10733 from justinmk/test-fixes
test: use shell-test (avoid system shell)
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r--test/functional/helpers.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index 2f76f24d84..73f3c4c917 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -302,6 +302,10 @@ end
local function nvim_feed(input)
while #input > 0 do
local written = module.request('nvim_input', input)
+ if written == nil then
+ module.assert_alive()
+ error('nvim_input returned nil (Nvim process terminated?)')
+ end
input = input:sub(written + 1)
end
end
@@ -586,6 +590,11 @@ function module.expect_any(contents)
return ok(nil ~= string.find(module.curbuf_contents(), contents, 1, true))
end
+-- Checks that the Nvim session did not terminate.
+function module.assert_alive()
+ eq(2, module.eval('1+1'))
+end
+
local function do_rmdir(path)
if lfs.attributes(path, 'mode') ~= 'directory' then
return -- Don't complain.