File: 001_load_rule.t

package info (click to toggle)
libnet-sieve-script-perl 0.09-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 292 kB
  • sloc: perl: 2,819; makefile: 2
file content (33 lines) | stat: -rw-r--r-- 878 bytes parent folder | download | duplicates (4)
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
31
32
33
use Test::More tests => 2;
use strict;

use lib qw(lib);

BEGIN { use_ok( 'Net::Sieve::Script::Rule' ); }

my $command = ' fileinto "INBOX.spam" ';

# test case on keywords
my $rule = Net::Sieve::Script::Rule->new(
    ctrl => 'iF',
    block => 'Fileinto "spam"; 
    stop;',
    test_list => 'anYof (NOT Address :aLl :contains ["To", "Cc", "Bcc"] "me@example.com", 
                        heaDer :Matches "subject" ["*make*money*fast*", "*university*dipl*mas*"])',
    order => 1
    );

my $waiting_res = 'if  anyof ( 
   not address :all :contains ["To", "Cc", "Bcc"] "me@example.com",
   header :matches "subject" ["*make*money*fast*", "*university*dipl*mas*"] )
    {
    fileinto "spam";
    stop;
    } ';

is ($rule->write,$waiting_res,"good writing");

#print $rule->write_action."\n";
#print $rule->write_condition."\n";
#print "======\n";
#print $rule->write."\n";