-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0076010
commit 0915a83
Showing
2 changed files
with
22 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
local Notify = worldeditadditions_core.notify | ||
worldeditadditions.normalize_test("suppress", { | ||
params = "N/A", | ||
description = "Tests notification suppression system.", | ||
func = function(name, params_table) | ||
Notify.suppress_for_player(name, 5) | ||
Notify.warn(name, "This message should not be shown.") | ||
Notify.suppress_for_player(name, -1) | ||
Notify.ok(name, "This message should be shown.") | ||
local result = Notify.suppress_for_function(name, function() | ||
Notify.error(name, "This message should not be shown.") | ||
return true | ||
end) | ||
if not result then | ||
Notify.error(name, "Error: suppress_for_function did not call function.") | ||
else | ||
Notify.ok(name, "suppress_for_function called function.") | ||
end | ||
end | ||
}) |