spamassassin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j.@apache.org
Subject svn commit: r473728 - in /spamassassin/trunk/t: get_headers.t mkrules.t
Date Sat, 11 Nov 2006 15:28:35 GMT
Author: jm
Date: Sat Nov 11 07:28:35 2006
New Revision: 473728

URL: http://svn.apache.org/viewvc?view=rev&rev=473728
Log:
remove tests of rulesrc/core; this is no longer supported by mkrules so tests were breaking

Modified:
    spamassassin/trunk/t/get_headers.t
    spamassassin/trunk/t/mkrules.t

Modified: spamassassin/trunk/t/get_headers.t
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/get_headers.t?view=diff&rev=473728&r1=473727&r2=473728
==============================================================================
--- spamassassin/trunk/t/get_headers.t (original)
+++ spamassassin/trunk/t/get_headers.t Sat Nov 11 07:28:35 2006
@@ -21,7 +21,7 @@
 
 use Mail::SpamAssassin;
 
-plan tests => 11;
+plan tests => 13;
 
 ##############################################
 
@@ -41,6 +41,10 @@
 To8: "'Foo Blah'" <jm@foo>
 To9: "_$B!z8=6b$=$N>l$GEv$?$j!*!zEv_(B_$B$?$k!*!)$/$8!z7|>^%\%s%P!<!z_(B" <jm@foo>
 To10: "Some User" <"Some User"@foo>
+Hdr1:    foo  
+  bar
+	baz 
+  
 To11: "Some User"@foo
 
 Blah!
@@ -67,7 +71,9 @@
   if ($expect eq $result) {
     return 1;
   } else {
-    warn "try: '$try' failed! expect: '$expect' got: '$result'\n";
+    my $le=$expect;$le=~s/\t/\\t/gs;$le =~s/\n/\\n/gs;
+    my $lr=$result;$lr=~s/\t/\\t/gs;$lr =~s/\n/\\n/gs;
+    warn "try: '$try' failed! expect: '$le' got: '$lr'\n";
     return 0;
   }
 }
@@ -83,4 +89,6 @@
 ok(try('To9:addr', 'jm@foo'));
 ok(try('To10:addr', '"Some User"@foo'));
 ok(try('To11:addr', '"Some User"@foo'));
+ok(try('Hdr1', "foo   bar baz\n"));
+ok(try('Hdr1:raw', "    foo  \n  bar\n\tbaz \n  \n"));
 

Modified: spamassassin/trunk/t/mkrules.t
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/mkrules.t?view=diff&rev=473728&r1=473727&r2=473728
==============================================================================
--- spamassassin/trunk/t/mkrules.t (original)
+++ spamassassin/trunk/t/mkrules.t Sat Nov 11 07:28:35 2006
@@ -2,7 +2,7 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("mkrules");
-use Test; BEGIN { plan tests => 101 };
+use Test; BEGIN { plan tests => 81 };
 use File::Path;
 
 # ---------------------------------------------------------------------------
@@ -212,49 +212,6 @@
 save_tdir();
 
 # ---------------------------------------------------------------------------
-print " active plugin in core\n\n";
-
-%patterns = (
-  '70_sandbox.cf: WARNING: not listed in manifest file' => manif_found,
-  "loadplugin Good plugin.pm" => loadplugin_found,
-  "body GOOD eval:check_foo()"   => rule_line_1,
-  "describe GOOD desc_found"  => rule_line_2,
-  "ifplugin Good" => if1,
-  "endif" => endif_found,
-);
-%anti_patterns = (
-  "describe T_GOOD desc_found"  => rule_line_2,
-);
-
-mkpath ([ "$tdir/rulesrc/core", "$tdir/rules", ]);
-
-write_file("$tdir/MANIFEST", [ "rulesrc/core/20_foo.cf\n", "rulesrc/core/plugin.pm\n" ]);
-write_file("$tdir/MANIFEST.SKIP", [ "foo2\n" ]);
-write_file("$tdir/rules/active.list", [ "GOOD\n" ]);
-write_file("$tdir/rulesrc/core/20_foo.cf", [
-    "loadplugin Good plugin.pm\n",
-    "ifplugin Good\n",
-    "body GOOD eval:check_foo()\n",
-    "describe GOOD desc_found\n",
-    "endif\n",
-]);
-write_file("$tdir/rulesrc/core/plugin.pm", [
-    'package Good;',
-    'use Mail::SpamAssassin::Plugin; our @ISA = qw(Mail::SpamAssassin::Plugin);',
-    'sub new { my ($class, $m) = @_; $class = ref($class) || $class;',
-    'my $self = bless $class->SUPER::new($m), $class;',
-    '$self->register_eval_rule("check_foo"); return $self; }',
-    'sub check_foo { my ($self, $pms) = @_; return 1; }',
-]);
-
-ok (mkrun ("--src $tdir/rulesrc --out $tdir/rules --manifest $tdir/MANIFEST --manifestskip
$tdir/MANIFEST.SKIP --active $tdir/rules/active.list 2>&1", \&patterns_run_cb));
-checkfile("$tdir/rules/72_active.cf", \&patterns_run_cb);
-# checkfile("$tdir/rules/70_sandbox.cf", \&patterns_run_cb);
-ok (-f "$tdir/rules/plugin.pm");
-ok ok_all_patterns();
-save_tdir();
-
-# ---------------------------------------------------------------------------
 print " inactive plugin\n\n";
 
 %patterns = (
@@ -298,51 +255,6 @@
 ok ok_all_patterns();
 save_tdir();
 
-
-# ---------------------------------------------------------------------------
-print " inactive plugin in non-sandbox\n\n";
-
-%patterns = (
-  '70_inactive.cf: WARNING: not listed in manifest file' => manif_found,
-  "loadplugin Good plugin.pm" => loadplugin_found,
-  "ifplugin Good" => if1,
-  "body GOOD eval:check_foo()" => rule_line_1,
-  "describe GOOD desc_found" => rule_line_2,
-  "endif" => endif_found,
-);
-%anti_patterns = (
-  "describe T_GOOD desc_found"  => rule_line_2,
-);
-
-rmtree([ $tdir ]);
-mkpath ([ "$tdir/rulesrc/core", "$tdir/rules" ]);
-
-write_file("$tdir/MANIFEST", [ "rulesrc/sandbox/foo/20_foo.cf\n", "rulesrc/sandbox/foo/plugin.pm\n"
]);
-write_file("$tdir/MANIFEST.SKIP", [ "foo2\n" ]);
-write_file("$tdir/rules/active.list", [ "NOT_GOOD\n" ]);
-write_file("$tdir/rulesrc/core/20_foo.cf", [
-    "loadplugin Good plugin.pm\n",
-    "ifplugin Good\n",
-    "body GOOD eval:check_foo()\n",
-    "describe GOOD desc_found\n",
-    "endif\n",
-]);
-write_file("$tdir/rulesrc/core/plugin.pm", [
-    'package Good;',
-    'use Mail::SpamAssassin::Plugin; our @ISA = qw(Mail::SpamAssassin::Plugin);',
-    'sub new { my ($class, $m) = @_; $class = ref($class) || $class;',
-    'my $self = bless $class->SUPER::new($m), $class;',
-    '$self->register_eval_rule("check_foo"); return $self; }',
-    'sub check_foo { my ($self, $pms) = @_; return 1; }',
-]);
-
-ok (mkrun ("--src $tdir/rulesrc --out $tdir/rules --manifest $tdir/MANIFEST --manifestskip
$tdir/MANIFEST.SKIP --active $tdir/rules/active.list 2>&1", \&patterns_run_cb));
-# checkfile("$tdir/rules/70_sandbox.cf", \&patterns_run_cb);
-# checkfile("$tdir/rules/72_active.cf", \&patterns_run_cb);
-checkfile("$tdir/rules/70_inactive.cf", \&patterns_run_cb);
-ok (-f "$tdir/rules/plugin.pm");
-ok ok_all_patterns();
-save_tdir();
 
 # ---------------------------------------------------------------------------
 print " active plugin, but the .pm file is AWOL\n\n";



Mime
View raw message