diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-08-10 01:26:43 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-09-01 09:03:46 -0700 |
commit | 2c1749ce443c3bb15a719c947b186301bc8ef0b3 (patch) | |
tree | aa01edb3f9d716fb7c59d27057fafe8e1862be15 /test/functional/helpers.lua | |
parent | f63d952ca289430fe729b5fc133b2143b91cd24b (diff) | |
download | rneovim-2c1749ce443c3bb15a719c947b186301bc8ef0b3.tar.gz rneovim-2c1749ce443c3bb15a719c947b186301bc8ef0b3.tar.bz2 rneovim-2c1749ce443c3bb15a719c947b186301bc8ef0b3.zip |
test: assert_alive()
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r-- | test/functional/helpers.lua | 9 |
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. |