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/comparators | |
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 'pigeonhole/tests/comparators')
-rw-r--r-- | pigeonhole/tests/comparators/i-ascii-casemap.svtest | 39 | ||||
-rw-r--r-- | pigeonhole/tests/comparators/i-octet.svtest | 37 |
2 files changed, 76 insertions, 0 deletions
diff --git a/pigeonhole/tests/comparators/i-ascii-casemap.svtest b/pigeonhole/tests/comparators/i-ascii-casemap.svtest new file mode 100644 index 0000000..0891f3e --- /dev/null +++ b/pigeonhole/tests/comparators/i-ascii-casemap.svtest @@ -0,0 +1,39 @@ +require "vnd.dovecot.testsuite"; + +test_set "message" text: +From: stephan@example.org +Cc: frop@example.com +To: test@dovecot.example.net +X-A: This is a TEST header +Subject: Test Message + +Test! +. +; + +test "i;ascii-casemap :contains (1)" { + if not header :contains :comparator "i;ascii-casemap" "X-A" "TEST" { + test_fail "should have matched"; + } +} + +test "i;ascii-casemap :contains (2)" { + if not header :contains :comparator "i;ascii-casemap" "X-A" "test" { + test_fail "should have matched"; + } +} + +test "i;ascii-casemap :matches (1)" { + if not header :matches :comparator "i;ascii-casemap" "X-A" "This*TEST*r" { + test_fail "should have matched"; + } +} + +test "i;ascii-casemap :matches (2)" { + if not header :matches :comparator "i;ascii-casemap" "X-A" "ThIs*tEsT*R" { + test_fail "should have matched"; + } +} + + + diff --git a/pigeonhole/tests/comparators/i-octet.svtest b/pigeonhole/tests/comparators/i-octet.svtest new file mode 100644 index 0000000..b6041bc --- /dev/null +++ b/pigeonhole/tests/comparators/i-octet.svtest @@ -0,0 +1,37 @@ +require "vnd.dovecot.testsuite"; + +test_set "message" text: +From: stephan@example.org +Cc: frop@example.com +To: test@dovecot.example.net +X-A: This is a TEST header +Subject: Test Message + +Test! +. +; + +test "i;octet :contains" { + if not header :contains :comparator "i;octet" "X-A" "TEST" { + test_fail "should have matched"; + } +} + +test "i;octet not :contains" { + if header :contains :comparator "i;octet" "X-A" "test" { + test_fail "should not have matched"; + } +} + +test "i;octet :matches" { + if not header :matches :comparator "i;octet" "X-A" "This*TEST*r" { + test_fail "should have matched"; + } +} + +test "i;octet not :matches" { + if header :matches :comparator "i;octet" "X-A" "ThIs*tEsT*R" { + test_fail "should not have matched"; + } +} + |