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/testsuite.svtest | |
parent | Initial commit. (diff) | |
download | dovecot-f7548d6d28c313cf80e6f3ef89aed16a19815df1.tar.xz dovecot-f7548d6d28c313cf80e6f3ef89aed16a19815df1.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 'pigeonhole/tests/testsuite.svtest')
-rw-r--r-- | pigeonhole/tests/testsuite.svtest | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/pigeonhole/tests/testsuite.svtest b/pigeonhole/tests/testsuite.svtest new file mode 100644 index 0000000..349ba89 --- /dev/null +++ b/pigeonhole/tests/testsuite.svtest @@ -0,0 +1,75 @@ +require "vnd.dovecot.testsuite"; +require "envelope"; + +/* Test message environment */ + +test "Message Environment" { + test_set "message" text: +From: sirius@example.org +To: nico@frop.example.com +Subject: Frop! + +Frop! +. + ; + + if not header :contains "from" "example.org" { + test_fail "message data not set properly."; + } + + test_set "message" text: +From: nico@frop.example.com +To: stephan@nl.example.com +Subject: Friep! + +Friep! +. + ; + + if not header :is "from" "nico@frop.example.com" { + test_fail "message data not set properly."; + } + + keep; +} + +/* Test envelope environment */ + +test "Envelope Environment" { + test_set "envelope.from" "stephan@hutsefluts.example.net"; + + if not envelope :is "from" "stephan@hutsefluts.example.net" { + test_fail "envelope.from data not set properly (1)."; + } + + test_set "envelope.to" "news@example.org"; + + if not envelope :is "to" "news@example.org" { + test_fail "envelope.to data not set properly (1)."; + } + + test_set "envelope.auth" "sirius"; + + if not envelope :is "auth" "sirius" { + test_fail "envelope.auth data not set properly (1)."; + } + + test_set "envelope.from" "stephan@example.org"; + + if not envelope :is "from" "stephan@example.org" { + test_fail "envelope.from data not reset properly (2)."; + } + + test_set "envelope.to" "past-news@example.org"; + + if not envelope :is "to" "past-news@example.org" { + test_fail "envelope.to data not reset properly (2)."; + } + + test_set "envelope.auth" "zilla"; + + if not envelope :is "auth" "zilla" { + test_fail "envelope.auth data not reset properly (2)."; + } +} + |