Skip to content

Commit

Permalink
tweak to test handling
Browse files Browse the repository at this point in the history
  • Loading branch information
VorTechnix committed Oct 17, 2024
1 parent 67e1e95 commit f6b0722
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ worldeditadditions.normalize_test("credits", {
end
end
send_credits(1)
return true, "Thank you!"
end
})
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
5 changes: 4 additions & 1 deletion worldeditadditions_core/utils/format/handle_fn_result.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 \"",
Expand Down

0 comments on commit f6b0722

Please sign in to comment.