tweak to test handling

This commit is contained in:
VorTechnix 2024-10-17 11:12:53 -07:00
parent 67e1e957d4
commit f6b072237b
No known key found for this signature in database
GPG Key ID: 091E91A69545D5BA
5 changed files with 9 additions and 3 deletions

@ -23,5 +23,6 @@ worldeditadditions.normalize_test("credits", {
end end
end end
send_credits(1) send_credits(1)
return true, "Thank you!"
end end
}) })

@ -9,5 +9,6 @@ worldeditadditions.normalize_test("notify", {
Notify.ok(name, message) Notify.ok(name, message)
Notify.info(name, message) Notify.info(name, message)
Notify.custom(name, "@" .. name, "Good Job", "#FF00D7") Notify.custom(name, "@" .. name, "Good Job", "#FF00D7")
return true
end end
}) })

@ -23,5 +23,6 @@ worldeditadditions.normalize_test("notifybad", {
Notify.warn(name, "Invalid color test:") Notify.warn(name, "Invalid color test:")
Notify.custom(name, "bad", message, "#FF00") -- Bad colour Notify.custom(name, "bad", message, "#FF00") -- Bad colour
return true, "Test complete."
end end
}) })

@ -12,9 +12,9 @@ worldeditadditions.normalize_test("suppress", {
return true return true
end) end)
if not result then if not result then
Notify.error(name, "Error: suppress_for_function did not call function.") return false, "Error: suppress_for_function did not call function."
else else
Notify.ok(name, "suppress_for_function called function.") return true, "suppress_for_function called function."
end end
end end
}) })

@ -11,7 +11,10 @@ local function handle_fn_result(...)
if #result > 1 then if #result > 1 then
ret = wea_c.table.tostring(result) ret = wea_c.table.tostring(result)
elseif #result == 1 then elseif #result == 1 then
ret = tostring(result[1]) if type(result[1]) == "table" then
ret = "Function returned table:\n" ..
wea_c.table.tostring(result[1])
else ret = tostring(result[1]) end
else else
ret = table.concat({ ret = table.concat({
"Function returned \"", "Function returned \"",