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/flagstring.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/flagstring.svtest | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/pigeonhole/tests/extensions/imap4flags/flagstring.svtest b/pigeonhole/tests/extensions/imap4flags/flagstring.svtest new file mode 100644 index 0000000..23b6b34 --- /dev/null +++ b/pigeonhole/tests/extensions/imap4flags/flagstring.svtest @@ -0,0 +1,82 @@ +require "vnd.dovecot.testsuite"; +require "imap4flags"; +require "variables"; + +test "Duplicates: setflag" { + setflag "flags" "\\seen \\seen"; + + if not string "${flags}" "\\seen" { + test_fail "duplicate \\seen flag item not removed (1)"; + } + + setflag "flags" "\\seen $frop \\seen"; + + if not string "${flags}" "\\seen $frop" { + test_fail "duplicate \\seen flag item not removed (2)"; + } + + setflag "flags" "\\seen $frop $frop \\seen"; + + if not string "${flags}" "\\seen $frop" { + test_fail "duplicate \\seen flag item not removed (3)"; + } + + setflag "flags" "$frop \\seen $frop \\seen"; + + if not string "${flags}" "$frop \\seen" { + test_fail "duplicate \\seen flag item not removed (4)"; + } + + setflag "flags" "$frop \\seen \\seen \\seen \\seen $frop $frop $frop \\seen"; + + if not string "${flags}" "$frop \\seen" { + test_fail "duplicate \\seen flag item not removed (5)"; + } +} + +test "Duplicates: addflag" { + setflag "flags" ""; + addflag "flags" "\\seen \\seen"; + + if not string "${flags}" "\\seen" { + test_fail "duplicate \\seen flag item not removed (1)"; + } + + setflag "flags" ""; + addflag "flags" "\\seen $frop \\seen"; + + if not string "${flags}" "\\seen $frop" { + test_fail "duplicate \\seen flag item not removed (2)"; + } + + setflag "flags" ""; + addflag "flags" "\\seen $frop $frop \\seen"; + + if not string "${flags}" "\\seen $frop" { + test_fail "duplicate \\seen flag item not removed (3)"; + } + + setflag "flags" ""; + addflag "flags" "$frop \\seen $frop \\seen"; + + if not string "${flags}" "$frop \\seen" { + test_fail "duplicate \\seen flag item not removed (4)"; + } + + setflag "flags" ""; + addflag "flags" "$frop \\seen \\seen \\seen \\seen $frop $frop $frop \\seen"; + + if not string "${flags}" "$frop \\seen" { + test_fail "duplicate \\seen flag item not removed (5)"; + } + + setflag "flags" "$frop \\seen"; + addflag "flags" "\\seen \\seen \\seen $frop $frop $frop \\seen"; + + if not string "${flags}" "$frop \\seen" { + test_fail "duplicate \\seen flag item not removed (6)"; + } +} + + + |