~ubuntu-branches/ubuntu/utopic/spamassassin/utopic-updates

« back to all changes in this revision

Viewing changes to t/autolearn.t

  • Committer: Package Import Robot
  • Author(s): Noah Meyerhans
  • Date: 2014-02-14 22:45:15 UTC
  • mfrom: (0.8.1) (0.6.2) (5.1.22 sid)
  • Revision ID: package-import@ubuntu.com-20140214224515-z1es2twos8xh7n2y
Tags: 3.4.0-1
* New upstream version! (Closes: 738963, 738872, 738867)
* Scrub the environment when switching to the debian-spamd user in
  postinst and cron.daily. (Closes: 738951)
* Enhancements to postinst to better manage ownership of
  /var/lib/spamassassin, via Iain Lane <iain.lane@canonical.com>
  (Closes: 738974)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
 
 
3
use lib '.'; use lib 't';
 
4
use SATest; sa_t_init("autolearn");
 
5
use Test;
 
6
 
 
7
use constant TEST_ENABLED => eval { require DB_File; };
 
8
 
 
9
BEGIN {
 
10
  plan tests => (TEST_ENABLED ? 2 : 0);
 
11
};
 
12
 
 
13
exit unless TEST_ENABLED;
 
14
 
 
15
 
 
16
# ---------------------------------------------------------------------------
 
17
 
 
18
%patterns = (
 
19
 
 
20
q{ autolearn=spam } => 'autolearned as spam'
 
21
 
 
22
);
 
23
 
 
24
%anti_patterns = (
 
25
);
 
26
 
 
27
tstprefs ('
 
28
 
 
29
body    AUTOLEARNTEST_BODY      /EVOLUTION PREVIEW RELEASE/
 
30
score   AUTOLEARNTEST_BODY      1.5
 
31
 
 
32
body    AUTOLEARNTEST_BODY2     /GET SOURCE CODE/
 
33
score   AUTOLEARNTEST_BODY2     1.5
 
34
 
 
35
body    AUTOLEARNTEST_BODY3     /RELEASE NOTES/
 
36
score   AUTOLEARNTEST_BODY3     1.5
 
37
 
 
38
header  AUTOLEARNTEST_HEAD      From =~ /@/
 
39
score   AUTOLEARNTEST_HEAD      1.5
 
40
 
 
41
header  AUTOLEARNTEST_HEAD2     Subject =~ /HC Announce/
 
42
score   AUTOLEARNTEST_HEAD2     1.5
 
43
 
 
44
header  AUTOLEARNTEST_HEAD3     Precedence =~ /bulk/
 
45
score   AUTOLEARNTEST_HEAD3     1.5
 
46
 
 
47
use_bayes 1
 
48
bayes_auto_learn 1
 
49
bayes_auto_learn_threshold_spam 6.0
 
50
 
 
51
');
 
52
 
 
53
ok (sarun ("-L -t < data/nice/001", \&patterns_run_cb));
 
54
ok_all_patterns();