diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:51:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:51:24 +0000 |
commit | f7548d6d28c313cf80e6f3ef89aed16a19815df1 (patch) | |
tree | a3f6f2a3f247293bee59ecd28e8cd8ceb6ca064a /pigeonhole/tests/extensions/imap4flags/execute.svtest | |
parent | Initial commit. (diff) | |
download | dovecot-upstream.tar.xz dovecot-upstream.zip |
Adding upstream version 1:2.3.19.1+dfsg1.upstream/1%2.3.19.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | pigeonhole/tests/extensions/imap4flags/execute.svtest | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/pigeonhole/tests/extensions/imap4flags/execute.svtest b/pigeonhole/tests/extensions/imap4flags/execute.svtest new file mode 100644 index 0000000..1ee1906 --- /dev/null +++ b/pigeonhole/tests/extensions/imap4flags/execute.svtest @@ -0,0 +1,68 @@ +require "vnd.dovecot.testsuite"; +require "imap4flags"; +require "relational"; + + +/* + * Execution testing + */ + +test_mailbox_create "INBOX.Junk"; +test_mailbox_create "INBOX.Nonsense"; + +test "Flags Side Effect" { + if not test_script_compile "execute/flags-side-effect.sieve" { + test_fail "script compile failed"; + } + + if not test_script_run { + test_fail "script execute failed"; + } + + if not test_result_execute { + test_fail "result execute failed"; + } + + test_result_reset; + + if not test_message :folder "INBOX.Junk" 0 { + test_fail "message not stored in INBOX.Junk"; + } + + if not hasflag :count "eq" "1" { + test_fail "invalid number of flags for message in INBOX.Junk"; + } + + if not hasflag :is "NONSENSE" { + test_fail "invalid flag set for message in INBOX.Junk"; + } + + test_result_reset; + + if not test_message :folder "INBOX" 0 { + test_fail "message not stored in INBOX"; + } + + if not hasflag :count "eq" "1" { + test_fail "invalid number of flags for message in INBOX"; + } + + if not hasflag :is "\\seen" { + test_fail "invalid flag set for message in INBOX"; + } + + test_result_reset; + + if not test_message :folder "INBOX.Nonsense" 0 { + test_fail "message not stored in INBOX.Nonsense"; + } + + if not hasflag :count "eq" "1" { + test_fail "invalid number of flags for message in Inbox.Nonsense"; + } + + if not hasflag :is "IMPLICIT" { + test_fail "invalid flag set for message in Inbox.Nonsene"; + } + +} |