mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
functests: Improve error reporting in _check_parsing function
May be needed for unit tests as well though.
This commit is contained in:
parent
e243dbdc32
commit
a2dfeb8a16
@ -951,9 +951,20 @@ describe('api', function()
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
if not err then
|
if not err then
|
||||||
msg = format_string('Error while processing test (%r, %s):\n%s',
|
if type(msg) == 'table' then
|
||||||
str, FLAGS_TO_STR[flags], msg)
|
local merr, new_msg = pcall(
|
||||||
error(msg)
|
format_string, 'table error:\n%s\n\n(%r)', msg.message, msg)
|
||||||
|
if merr then
|
||||||
|
msg = new_msg
|
||||||
|
else
|
||||||
|
msg = format_string('table error without .message:\n(%r)',
|
||||||
|
msg)
|
||||||
|
end
|
||||||
|
elseif type(msg) ~= 'string' then
|
||||||
|
msg = format_string('non-string non-table error:\n%r', msg)
|
||||||
|
end
|
||||||
|
error(format_string('Error while processing test (%r, %s):\n%s',
|
||||||
|
str, FLAGS_TO_STR[flags], msg))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user