aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/functional/helpers.lua4
-rw-r--r--test/functional/ui/screen.lua7
2 files changed, 8 insertions, 3 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index 73f3c4c917..c718a37021 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -304,7 +304,7 @@ local function nvim_feed(input)
local written = module.request('nvim_input', input)
if written == nil then
module.assert_alive()
- error('nvim_input returned nil (Nvim process terminated?)')
+ error('crash? (nvim_input returned nil)')
end
input = input:sub(written + 1)
end
@@ -592,7 +592,7 @@ end
-- Checks that the Nvim session did not terminate.
function module.assert_alive()
- eq(2, module.eval('1+1'))
+ assert(2 == module.eval('1+1'), 'crash? request failed')
end
local function do_rmdir(path)
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index 02be714e0d..0e3b903398 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -615,7 +615,12 @@ function Screen:_redraw(updates)
local handler_name = '_handle_'..method
local handler = self[handler_name]
if handler ~= nil then
- handler(self, unpack(update[i]))
+ local status, res = pcall(handler, self, unpack(update[i]))
+ if not status then
+ error(handler_name..' failed'
+ ..'\n payload: '..inspect(update)
+ ..'\n error: '..tostring(res))
+ end
else
assert(self._on_event,
"Add Screen:"..handler_name.." or call Screen:set_on_event_handler")