summaryrefslogtreecommitdiff
path: root/sieve
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2002-11-19 13:55:40 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2002-11-19 13:55:40 +0000
commitc01ff47b1ee1758173c5aba9a3161ba35feb21e6 (patch)
tree25bc17aabc87896a489e5b5c695f272245c6c0a8 /sieve
parent10ad8457f0a2874c9bcb3a393d63f2d5582f1144 (diff)
downloadmailutils-c01ff47b1ee1758173c5aba9a3161ba35feb21e6.tar.gz
mailutils-c01ff47b1ee1758173c5aba9a3161ba35feb21e6.tar.bz2
Added scripts for testing comparators.
Diffstat (limited to 'sieve')
-rw-r--r--sieve/testsuite/scripts/i-casemap-contains.sv11
-rw-r--r--sieve/testsuite/scripts/i-casemap-is.sv11
-rw-r--r--sieve/testsuite/scripts/i-casemap-matches.sv11
-rw-r--r--sieve/testsuite/scripts/i-casemap-regex.sv11
-rw-r--r--sieve/testsuite/scripts/i-numeric-contains.sv11
-rw-r--r--sieve/testsuite/scripts/i-numeric-is.sv11
-rw-r--r--sieve/testsuite/scripts/i-octet-contains.sv11
-rw-r--r--sieve/testsuite/scripts/i-octet-is.sv11
-rw-r--r--sieve/testsuite/scripts/i-octet-matches.sv11
-rw-r--r--sieve/testsuite/scripts/i-octet-regex.sv11
-rw-r--r--sieve/testsuite/sieve/DISTFILES3
-rw-r--r--sieve/testsuite/sieve/i-casemap.exp39
-rw-r--r--sieve/testsuite/sieve/i-numeric.exp27
-rw-r--r--sieve/testsuite/sieve/i-octet.exp39
14 files changed, 218 insertions, 0 deletions
diff --git a/sieve/testsuite/scripts/i-casemap-contains.sv b/sieve/testsuite/scripts/i-casemap-contains.sv
new file mode 100644
index 000000000..fba1a234a
--- /dev/null
+++ b/sieve/testsuite/scripts/i-casemap-contains.sv
@@ -0,0 +1,11 @@
+# -*- sieve -*-
+# This file is part of Mailutils testsuite.
+# Copyright (C) 2002, Free Software Foundation.
+# See file COPYING for distribution conditions.
+
+require "comparator-i;ascii-casemap";
+
+if header :comparator "i;ascii-casemap" :contains ["from", "to"] "ExAmPLe"
+ {
+ discard;
+ }
diff --git a/sieve/testsuite/scripts/i-casemap-is.sv b/sieve/testsuite/scripts/i-casemap-is.sv
new file mode 100644
index 000000000..d465dc3e5
--- /dev/null
+++ b/sieve/testsuite/scripts/i-casemap-is.sv
@@ -0,0 +1,11 @@
+# -*- sieve -*-
+# This file is part of Mailutils testsuite.
+# Copyright (C) 2002, Free Software Foundation.
+# See file COPYING for distribution conditions.
+
+require "comparator-i;ascii-casemap";
+
+if header :comparator "i;ascii-casemap" :is "to" "roadrunner@ACME.EXAMPLE.COM"
+ {
+ discard;
+ }
diff --git a/sieve/testsuite/scripts/i-casemap-matches.sv b/sieve/testsuite/scripts/i-casemap-matches.sv
new file mode 100644
index 000000000..26432617b
--- /dev/null
+++ b/sieve/testsuite/scripts/i-casemap-matches.sv
@@ -0,0 +1,11 @@
+# -*- sieve -*-
+# This file is part of Mailutils testsuite.
+# Copyright (C) 2002, Free Software Foundation.
+# See file COPYING for distribution conditions.
+
+require "comparator-i;ascii-casemap";
+
+if header :comparator "i;ascii-casemap" :matches "subject" "*you, too,*"
+ {
+ discard;
+ }
diff --git a/sieve/testsuite/scripts/i-casemap-regex.sv b/sieve/testsuite/scripts/i-casemap-regex.sv
new file mode 100644
index 000000000..d6ae6520a
--- /dev/null
+++ b/sieve/testsuite/scripts/i-casemap-regex.sv
@@ -0,0 +1,11 @@
+# -*- sieve -*-
+# This file is part of Mailutils testsuite.
+# Copyright (C) 2002, Free Software Foundation.
+# See file COPYING for distribution conditions.
+
+require "comparator-i;ascii-casemap";
+
+if header :comparator "i;ascii-casemap" :regex "subject" ".*you.*"
+ {
+ discard;
+ }
diff --git a/sieve/testsuite/scripts/i-numeric-contains.sv b/sieve/testsuite/scripts/i-numeric-contains.sv
new file mode 100644
index 000000000..6134371b1
--- /dev/null
+++ b/sieve/testsuite/scripts/i-numeric-contains.sv
@@ -0,0 +1,11 @@
+# -*- sieve -*-
+# This file is part of Mailutils testsuite.
+# Copyright (C) 2002, Free Software Foundation.
+# See file COPYING for distribution conditions.
+
+require "comparator-i;ascii-numeric";
+
+if header :comparator "i;ascii-numeric" :contains "X-Number" "15"
+ {
+ discard;
+ }
diff --git a/sieve/testsuite/scripts/i-numeric-is.sv b/sieve/testsuite/scripts/i-numeric-is.sv
new file mode 100644
index 000000000..7842d8bb1
--- /dev/null
+++ b/sieve/testsuite/scripts/i-numeric-is.sv
@@ -0,0 +1,11 @@
+# -*- sieve -*-
+# This file is part of Mailutils testsuite.
+# Copyright (C) 2002, Free Software Foundation.
+# See file COPYING for distribution conditions.
+
+require "comparator-i;ascii-numeric";
+
+if header :comparator "i;ascii-numeric" :is "X-Number" "15"
+ {
+ discard;
+ }
diff --git a/sieve/testsuite/scripts/i-octet-contains.sv b/sieve/testsuite/scripts/i-octet-contains.sv
new file mode 100644
index 000000000..d8e318292
--- /dev/null
+++ b/sieve/testsuite/scripts/i-octet-contains.sv
@@ -0,0 +1,11 @@
+# -*- sieve -*-
+# This file is part of Mailutils testsuite.
+# Copyright (C) 2002, Free Software Foundation.
+# See file COPYING for distribution conditions.
+
+require "comparator-i;octet";
+
+if header :comparator "i;octet" :contains ["from", "to"] "example"
+ {
+ discard;
+ }
diff --git a/sieve/testsuite/scripts/i-octet-is.sv b/sieve/testsuite/scripts/i-octet-is.sv
new file mode 100644
index 000000000..22f686764
--- /dev/null
+++ b/sieve/testsuite/scripts/i-octet-is.sv
@@ -0,0 +1,11 @@
+# -*- sieve -*-
+# This file is part of Mailutils testsuite.
+# Copyright (C) 2002, Free Software Foundation.
+# See file COPYING for distribution conditions.
+
+require "comparator-i;octet";
+
+if header :comparator "i;octet" :is "to" "roadrunner@acme.example.com"
+ {
+ discard;
+ }
diff --git a/sieve/testsuite/scripts/i-octet-matches.sv b/sieve/testsuite/scripts/i-octet-matches.sv
new file mode 100644
index 000000000..840e1fb81
--- /dev/null
+++ b/sieve/testsuite/scripts/i-octet-matches.sv
@@ -0,0 +1,11 @@
+# -*- sieve -*-
+# This file is part of Mailutils testsuite.
+# Copyright (C) 2002, Free Software Foundation.
+# See file COPYING for distribution conditions.
+
+require "comparator-i;octet";
+
+if header :comparator "i;octet" :matches "subject" "$$$*$$$"
+ {
+ discard;
+ }
diff --git a/sieve/testsuite/scripts/i-octet-regex.sv b/sieve/testsuite/scripts/i-octet-regex.sv
new file mode 100644
index 000000000..61dd58f09
--- /dev/null
+++ b/sieve/testsuite/scripts/i-octet-regex.sv
@@ -0,0 +1,11 @@
+# -*- sieve -*-
+# This file is part of Mailutils testsuite.
+# Copyright (C) 2002, Free Software Foundation.
+# See file COPYING for distribution conditions.
+
+require "comparator-i;octet";
+
+if header :comparator "i;octet" :regex "subject" ".*you.*"
+ {
+ discard;
+ }
diff --git a/sieve/testsuite/sieve/DISTFILES b/sieve/testsuite/sieve/DISTFILES
index 34aba2a2a..089ce213b 100644
--- a/sieve/testsuite/sieve/DISTFILES
+++ b/sieve/testsuite/sieve/DISTFILES
@@ -6,6 +6,9 @@ envelope.exp
exists.exp
false.exp
header.exp
+i-casemap.exp
+i-numeric.exp
+i-octet.exp
not.exp
redirect.exp
reject.exp
diff --git a/sieve/testsuite/sieve/i-casemap.exp b/sieve/testsuite/sieve/i-casemap.exp
new file mode 100644
index 000000000..2f8aa7b74
--- /dev/null
+++ b/sieve/testsuite/sieve/i-casemap.exp
@@ -0,0 +1,39 @@
+# -*- tcl -*-
+# This file is part of Mailutils testsuite.
+# Copyright (C) 2002, Free Software Foundation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+sieve_test i-casemap-is.sv -pattern \
+ "DISCARD on msg uid 1: marking as deleted"\
+ "IMPLICIT KEEP on msg uid 2"\
+ "IMPLICIT KEEP on msg uid 3"
+
+sieve_test i-casemap-matches.sv -pattern \
+ "IMPLICIT KEEP on msg uid 1"\
+ "DISCARD on msg uid 2: marking as deleted"\
+ "IMPLICIT KEEP on msg uid 3"
+
+sieve_test i-casemap-contains.sv -pattern \
+ "DISCARD on msg uid 1: marking as deleted"\
+ "DISCARD on msg uid 2: marking as deleted"\
+ "IMPLICIT KEEP on msg uid 3"
+
+sieve_test i-casemap-regex.sv -pattern \
+ "DISCARD on msg uid 1: marking as deleted"\
+ "DISCARD on msg uid 2: marking as deleted"\
+ "IMPLICIT KEEP on msg uid 3"
+
+# end of i-casemap.exp
diff --git a/sieve/testsuite/sieve/i-numeric.exp b/sieve/testsuite/sieve/i-numeric.exp
new file mode 100644
index 000000000..13984d725
--- /dev/null
+++ b/sieve/testsuite/sieve/i-numeric.exp
@@ -0,0 +1,27 @@
+# -*- tcl -*-
+# This file is part of Mailutils testsuite.
+# Copyright (C) 2002, Free Software Foundation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+sieve_test i-numeric-is.sv -pattern \
+ "IMPLICIT KEEP on msg uid 1"\
+ "DISCARD on msg uid 2: marking as deleted"\
+ "IMPLICIT KEEP on msg uid 3"
+
+sieve_test i-numeric-contains.sv -retcode 1 -pattern \
+ -re ".*i-numeric-contains.sv:9: comparator `i;ascii-numeric' is incompatible with match type `contains' in call to `header'"
+
+# end of i-numeric.exp
diff --git a/sieve/testsuite/sieve/i-octet.exp b/sieve/testsuite/sieve/i-octet.exp
new file mode 100644
index 000000000..63642d6d0
--- /dev/null
+++ b/sieve/testsuite/sieve/i-octet.exp
@@ -0,0 +1,39 @@
+# -*- tcl -*-
+# This file is part of Mailutils testsuite.
+# Copyright (C) 2002, Free Software Foundation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+sieve_test i-octet-is.sv -pattern \
+ "DISCARD on msg uid 1: marking as deleted"\
+ "IMPLICIT KEEP on msg uid 2"\
+ "IMPLICIT KEEP on msg uid 3"
+
+sieve_test i-octet-matches.sv -pattern \
+ "IMPLICIT KEEP on msg uid 1"\
+ "DISCARD on msg uid 2: marking as deleted"\
+ "IMPLICIT KEEP on msg uid 3"
+
+sieve_test i-octet-contains.sv -pattern \
+ "DISCARD on msg uid 1: marking as deleted"\
+ "DISCARD on msg uid 2: marking as deleted"\
+ "IMPLICIT KEEP on msg uid 3"
+
+sieve_test i-octet-regex.sv -pattern \
+ "DISCARD on msg uid 1: marking as deleted"\
+ "IMPLICIT KEEP on msg uid 2"\
+ "IMPLICIT KEEP on msg uid 3"
+
+# end of i-octet.exp

Return to:

Send suggestions and report system problems to the System administrator.