File: prefs_include.t

package info (click to toggle)
spamassassin 4.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,724 kB
  • sloc: perl: 89,143; ansic: 5,193; sh: 3,737; javascript: 339; sql: 295; makefile: 209; python: 49
file content (30 lines) | stat: -rwxr-xr-x 853 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/perl -T

use lib '.'; use lib 't';
use SATest; sa_t_init("prefs_include");
use Test::More tests => 3;

$ENV{'LANGUAGE'} = $ENV{'LC_ALL'} = 'C';             # a cheat, but we need the patterns to work

# ---------------------------------------------------------------------------

%patterns = (
  qr/^X-Spam-Report:\s*$/m, 'qp-encoded-hdr',
  qr/^\t\*\s+[0-9.-]+ INVALID_DATE\s+Invalid Date: header =\?UTF-8\?B\?wq4gwq8gwrA=\?=$/m, 'qp-encoded-desc',
  qr/^ [0-9.-]+ INVALID_DATE\s+Invalid Date: header ® ¯ °$/m, 'report-desc',
);

tstprefs ("
  include prefs_include.inc
");

open (OUT, ">$localrules/prefs_include.inc") or die "open $workdir/prefs_include.inc failed";
print OUT "
  report_safe 0
  describe INVALID_DATE Invalid Date: header ® ¯ °
";
close OUT;

sarun ("-L -t < data/spam/001", \&patterns_run_cb);
ok_all_patterns();