File: basic_lint.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 (38 lines) | stat: -rwxr-xr-x 791 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
31
32
33
34
35
36
37
38
#!/usr/bin/perl -T

use lib '.'; use lib 't';
use SATest; sa_t_init("basic_lint");

use Test::More;

tstpre ("
  loadplugin Mail::SpamAssassin::Plugin::AWL
");

@test_locales = qw(C);

if (!$RUNNING_ON_WINDOWS) {
  # Test with few random additional locales if available
  my $locales = untaint_cmd("locale -a");
  while ($locales =~ /^((?:C|en_US|fr_FR|zh_CN)\.(?:utf|iso).*)$/gmi) {
    push @test_locales, $1;
  }
}

plan tests => scalar(@test_locales);

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

%patterns = (
  qr/^/, 'anything',
);

foreach my $locale (@test_locales) {
  my $language = $locale;
  $language =~ s/[._].*//;
  $ENV{'LANGUAGE'} = $language;
  $ENV{'LC_ALL'} = $locale;
  sarun ("-L --lint", \&patterns_run_cb);
  ok_all_patterns();
}