You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2006/04/19 20:32:04 UTC

svn commit: r395341 - in /spamassassin/branches/bug-3109-shortcircuiting: MANIFEST t/shortcircuit.t

Author: jm
Date: Wed Apr 19 11:32:02 2006
New Revision: 395341

URL: http://svn.apache.org/viewcvs?rev=395341&view=rev
Log:
bug 3109: add test script for short-circuiting

Added:
    spamassassin/branches/bug-3109-shortcircuiting/t/shortcircuit.t   (with props)
Modified:
    spamassassin/branches/bug-3109-shortcircuiting/MANIFEST

Modified: spamassassin/branches/bug-3109-shortcircuiting/MANIFEST
URL: http://svn.apache.org/viewcvs/spamassassin/branches/bug-3109-shortcircuiting/MANIFEST?rev=395341&r1=395340&r2=395341&view=diff
==============================================================================
--- spamassassin/branches/bug-3109-shortcircuiting/MANIFEST (original)
+++ spamassassin/branches/bug-3109-shortcircuiting/MANIFEST Wed Apr 19 11:32:02 2006
@@ -477,3 +477,4 @@
 t/data/nice/dkim/Simple_02
 t/dkim.t
 rules/v320.pre
+t/shortcircuit.t

Added: spamassassin/branches/bug-3109-shortcircuiting/t/shortcircuit.t
URL: http://svn.apache.org/viewcvs/spamassassin/branches/bug-3109-shortcircuiting/t/shortcircuit.t?rev=395341&view=auto
==============================================================================
--- spamassassin/branches/bug-3109-shortcircuiting/t/shortcircuit.t (added)
+++ spamassassin/branches/bug-3109-shortcircuiting/t/shortcircuit.t Wed Apr 19 11:32:02 2006
@@ -0,0 +1,43 @@
+#!/usr/bin/perl
+
+use lib '.'; use lib 't';
+use SATest; sa_t_init("shortcircuit");
+use Test; BEGIN { plan tests => 8 };
+
+# ---------------------------------------------------------------------------
+
+%anti_patterns = (
+q{ autolearn=ham } => 'autolearned as ham'
+);
+
+tstlocalrules ('
+
+  # hits spam/001
+  body X_FOO            /Congratulations/
+  header X_BAR          From =~ /sb55/
+  # this should still fire, fixing the meta dependency ordering automatically
+  meta SC_PRI_SPAM_001  (X_FOO && X_BAR)
+  shortcircuit SC_PRI_SPAM_001  spam
+  priority SC_PRI_SPAM_001 -1000
+
+  # hits spam/002
+  header SC_002        Subject =~ /ADV/
+  shortcircuit SC_002  on
+  priority SC_002      -100
+  score SC_002         50
+
+');
+
+%patterns = (
+  q{ SC_PRI_SPAM_001 }, 'hit',
+  q{ shortcircuit=spam }, 'sc',
+);
+ok (sarun ("-L -t < data/spam/001", \&patterns_run_cb));
+ok_all_patterns();
+
+%patterns = (
+  q{ SC_002 }, 'hit',
+  q{ shortcircuit=spam }, 'sc',
+);
+ok (sarun ("-L -t < data/spam/002", \&patterns_run_cb));
+ok_all_patterns();

Propchange: spamassassin/branches/bug-3109-shortcircuiting/t/shortcircuit.t
------------------------------------------------------------------------------
    svn:executable = *