diff options
Diffstat (limited to 'pigeonhole/tests/extensions/imap4flags/execute.svtest')
-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"; + } + +} |