diff --git a/Makefile.am b/Makefile.am index 9657a4de4862fc0f7d958b54c9460ed7b1a7b62d..3e0005334923fc5c9199721df4e8de205aeddfad 100644 --- a/Makefile.am +++ b/Makefile.am @@ -88,6 +88,7 @@ test_cases = \ tests/extensions/enotify/mailto.svtest \ tests/extensions/environment/basic.svtest \ tests/extensions/environment/rfc.svtest \ + tests/extensions/mailbox/execute.svtest \ tests/multiscript/basic.svtest \ tests/deprecated/notify/basic.svtest \ tests/deprecated/notify/mailto.svtest \ diff --git a/tests/extensions/mailbox/execute.svtest b/tests/extensions/mailbox/execute.svtest new file mode 100644 index 0000000000000000000000000000000000000000..22c0d0f2991ffccd8b7d939237239899b442dbcb --- /dev/null +++ b/tests/extensions/mailbox/execute.svtest @@ -0,0 +1,48 @@ +require "vnd.dovecot.testsuite"; +require "mailbox"; +require "fileinto"; + +test "MailboxExists - None exist" { + if mailboxexists "frop" { + test_fail "mailboxexists confirms existance of unknown folder"; + } +} + +test_mailbox :create "frop"; +test_mailbox :create "friep"; + +test "MailboxExists - Not all exist" { + if mailboxexists ["frop", "friep", "frml"] { + test_fail "mailboxexists confirms existance of unknown folder"; + } +} + +test_mailbox :create "frml"; + +test "MailboxExists - One exists" { + if not mailboxexists ["frop"] { + test_fail "mailboxexists fails to recognize folder"; + } +} + +test "MailboxExists - All exist" { + if not mailboxexists ["frop", "friep", "frml"] { + test_fail "mailboxexists fails to recognize folders"; + } +} + +test ":Create" { + if mailboxexists "created" { + test_fail "mailbox exists already"; + } + + fileinto :create "created"; + + if not test_result_execute { + test_fail "execution of result failed"; + } + + if not mailboxexists "created" { + test_fail "mailbox somehow not created"; + } +}