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

View file

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

View file

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

View file

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

View file

@ -12,9 +12,9 @@ worldeditadditions.normalize_test("suppress", {
return true
end)
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
Notify.ok(name, "suppress_for_function called function.")
return true, "suppress_for_function called function."
end
end
})

View file

@ -11,7 +11,10 @@ local function handle_fn_result(...)
if #result > 1 then
ret = wea_c.table.tostring(result)
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
ret = table.concat({
"Function returned \"",