dovecot-2.2-pigeonhole: testsuite: Added syntax checks for body ...
pigeonhole at rename-it.nl
pigeonhole at rename-it.nl
Tue Dec 30 22:01:17 UTC 2014
details: http://hg.rename-it.nl/dovecot-2.2-pigeonhole/rev/c9698bc1751a
changeset: 1981:c9698bc1751a
user: Stephan Bosch <stephan at rename-it.nl>
date: Tue Dec 30 22:57:07 2014 +0100
description:
testsuite: Added syntax checks for body test.
diffstat:
Makefile.am | 1 +
tests/extensions/body/errors.svtest | 19 +++++++++++++++
tests/extensions/body/errors/syntax.sieve | 38 +++++++++++++++++++++++++++++++
3 files changed, 58 insertions(+), 0 deletions(-)
diffs (76 lines):
diff -r d7fb503ac03e -r c9698bc1751a Makefile.am
--- a/Makefile.am Tue Dec 30 22:56:11 2014 +0100
+++ b/Makefile.am Tue Dec 30 22:57:07 2014 +0100
@@ -106,6 +106,7 @@
tests/extensions/imap4flags/flagstring.svtest \
tests/extensions/imap4flags/flagstore.svtest \
tests/extensions/body/basic.svtest \
+ tests/extensions/body/errors.svtest \
tests/extensions/body/raw.svtest \
tests/extensions/body/content.svtest \
tests/extensions/body/match-values.svtest \
diff -r d7fb503ac03e -r c9698bc1751a tests/extensions/body/errors.svtest
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/extensions/body/errors.svtest Tue Dec 30 22:57:07 2014 +0100
@@ -0,0 +1,19 @@
+require "vnd.dovecot.testsuite";
+
+require "relational";
+require "comparator-i;ascii-numeric";
+
+/*
+ * Invalid syntax
+ */
+
+test "Invalid Syntax" {
+ if test_script_compile "errors/syntax.sieve" {
+ test_fail "compile should have failed";
+ }
+
+ if not test_error :count "eq" :comparator "i;ascii-numeric" "12" {
+ test_fail "wrong number of errors reported";
+ }
+}
+
diff -r d7fb503ac03e -r c9698bc1751a tests/extensions/body/errors/syntax.sieve
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/extensions/body/errors/syntax.sieve Tue Dec 30 22:57:07 2014 +0100
@@ -0,0 +1,38 @@
+require "body";
+
+# 1: No key list
+if body { }
+
+# 2: Number
+if body 3 { }
+
+# OK: String
+if body "frop" { }
+
+# 3: To many arguments
+if body "frop" "friep" { }
+
+# 4: Unknown tag
+if body :frop { }
+
+# 5: Unknown tag with valid key
+if body :friep "frop" { }
+
+# 6: Content without argument
+if body :content { }
+
+# 7: Content without key argument
+if body :content "frop" { }
+
+# 8: Content with number argument
+if body :content 3 "frop" { }
+
+# 9: Content with unknown tag
+if body :content :frml "frop" { }
+
+# 10: Content with known tag
+if body :content :contains "frop" { }
+
+# 11: Duplicate transform
+if body :content "frop" :raw "frop" { }
+
More information about the dovecot-cvs
mailing list