Commit c01ff47b c01ff47b1ee1758173c5aba9a3161ba35feb21e6 by Sergey Poznyakoff

Added scripts for testing comparators.

1 parent 10ad8457
# -*- 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;
}
# -*- 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;
}
# -*- 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;
}
# -*- 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;
}
# -*- 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;
}
# -*- 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;
}
# -*- 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;
}
# -*- 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;
}
# -*- 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;
}
# -*- 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;
}
......@@ -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
......
# -*- 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
# -*- 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
# -*- 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