dovecot-2.0-sieve: Imap4flags extension: added tests for flag string management.

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Thu Dec 31 20:56:29 EET 2009


details:   http://hg.rename-it.nl/dovecot-2.0-sieve/rev/607d8fa023a6
changeset: 1159:607d8fa023a6
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 cc65fb068714 -r 607d8fa023a6 Makefile.am
--- a/Makefile.am	Thu Dec 31 18:16:03 2009 +0100
+++ b/Makefile.am	Wed Dec 30 04:40:04 2009 +0100
@@ -60,6 +60,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 cc65fb068714 -r 607d8fa023a6 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