summaryrefslogtreecommitdiff
path: root/tests/test_utils/print_error.lua
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-06-09 11:34:07 +0800
committerOpportunityLiu <[email protected]>2019-06-09 11:34:07 +0800
commitdb9c880b656e33b056bd3e3804eb6009ea946fea (patch)
tree1d5ee9423a1f128bd00085aa6e05441fc4939e20 /tests/test_utils/print_error.lua
parentdca7c26579f7d7857810b58f95e177877f9933fa (diff)
fix
Diffstat (limited to 'tests/test_utils/print_error.lua')
-rw-r--r--tests/test_utils/print_error.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test_utils/print_error.lua b/tests/test_utils/print_error.lua
index d4a4438ab..dcf1e82bb 100644
--- a/tests/test_utils/print_error.lua
+++ b/tests/test_utils/print_error.lua
@@ -24,7 +24,7 @@ function main(t, message, funcs_or_filename, abort_reason)
cprint(">> ${red}test failed:${reset} %s", message)
for _, func in ipairs(funcs) do
local line = (func.currentline >= 0) and func.currentline or func.linedefined
- local name = (func.func == t.func) and t.funcname or func.name
+ local name = (func.func == t.func) and t.funcname or func.name or "(anonymous)"
cprint(">> function %s ${underline}%s${reset}:${bright}%d${reset}", name, func.source, line)
end
raise("aborting because of ${red}%s${reset} ...", abort_reason or "failed assertion")