mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-26 09:03:01 +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
|
||||||
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 \"",
|
||||||
|
|
Loading…
Reference in a new issue