dovecot-1.2-sieve: Imap4flags extension: added tests for flag string management.
pigeonhole at rename-it.nl
pigeonhole at rename-it.nl
Wed Dec 30 05:44:40 EET 2009
details: http://hg.rename-it.nl/dovecot-1.2-sieve/rev/1e42fa95f405
changeset: 1167:1e42fa95f405
user: Stephan Bosch <stephan at rename-it.nl>
date: Wed Dec 30 04:40:04 2009 +0100
description:
Imap4flags extension: added tests for flag string management.
diffstat:
Makefile.am | 1 +
tests/extensions/imap4flags/flagstring.svtest | 82 +++++++++++++++++++++++++++
2 files changed, 83 insertions(+), 0 deletions(-)
diffs (97 lines):
diff -r 88ea06612eeb -r 1e42fa95f405 Makefile.am
--- a/Makefile.am Mon Dec 28 19:41:31 2009 +0100
+++ b/Makefile.am Wed Dec 30 04:40:04 2009 +0100
@@ -77,6 +77,7 @@
tests/extensions/imap4flags/errors.svtest \
tests/extensions/imap4flags/execute.svtest \
tests/extensions/imap4flags/multiscript.svtest \
+ tests/extensions/imap4flags/flagstring.svtest \
tests/extensions/imap4flags/flagstore.svtest \
tests/extensions/body/basic.svtest \
tests/extensions/body/raw.svtest \
diff -r 88ea06612eeb -r 1e42fa95f405 tests/extensions/imap4flags/flagstring.svtest
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/extensions/imap4flags/flagstring.svtest Wed Dec 30 04:40:04 2009 +0100
@@ -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)";
+ }
+}
+
+
+
More information about the dovecot-cvs
mailing list