summaryrefslogtreecommitdiffstats
path: root/pigeonhole/tests/deprecated/notify/basic.svtest
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--pigeonhole/tests/deprecated/notify/basic.svtest59
1 files changed, 59 insertions, 0 deletions
diff --git a/pigeonhole/tests/deprecated/notify/basic.svtest b/pigeonhole/tests/deprecated/notify/basic.svtest
new file mode 100644
index 0000000..974f8ca
--- /dev/null
+++ b/pigeonhole/tests/deprecated/notify/basic.svtest
@@ -0,0 +1,59 @@
+require "vnd.dovecot.testsuite";
+require "notify";
+require "body";
+
+test "Execute" {
+ /* Test to catch runtime segfaults */
+ notify
+ :message "This is probably very important"
+ :low
+ :method "mailto"
+ :options ["stephan@example.com", "stephan@example.org"];
+
+ if not test_result_execute {
+ test_fail "Execute failed";
+ }
+}
+
+test_result_reset;
+
+test_set "message" text:
+To: user@example.com
+From: stephan@example.org
+Subject: Mail
+
+Test!
+.
+;
+
+test "Substitutions" {
+ notify
+ :message "$from$: $subject$"
+ :options "stephan@example.com";
+ if not test_result_execute {
+ test_fail "Execute failed";
+ }
+ test_message :smtp 0;
+ if not body :contains "stephan@example.org: Mail" {
+ test_fail "Substitution failed";
+ }
+}
+
+test_result_reset;
+
+test_set "message" text:
+To: user@example.com
+
+Test!
+.
+;
+
+test "Empty substitutions" {
+ notify
+ :message "$from$: $subject$"
+ :options "stephan@example.com";
+ if not test_result_execute {
+ test_fail "Execute failed";
+ }
+}
+