mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-22 15:33:00 +00:00
tweak to test handling
This commit is contained in:
parent
67e1e957d4
commit
f6b072237b
5 changed files with 9 additions and 3 deletions
|
@ -23,5 +23,6 @@ worldeditadditions.normalize_test("credits", {
|
|||
end
|
||||
end
|
||||
send_credits(1)
|
||||
return true, "Thank you!"
|
||||
end
|
||||
})
|
|
@ -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
|
||||
})
|
|
@ -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
|
||||
})
|
|
@ -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
|
||||
})
|
|
@ -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 \"",
|
||||
|
|
Loading…
Reference in a new issue