]> git.imager.perl.org - imager.git/blob - t/x20spell.t
[rt #79922] catch an invalid matrix supplied to convert()
[imager.git] / t / x20spell.t
1 #!perl -w
2 use strict;
3 use Test::More;
4 use ExtUtils::Manifest qw(maniread);
5 use File::Temp;
6 eval "use Pod::Spell 1.01";
7 plan skip_all => "Pod::Spell 1.01 required for spellchecking POD" if $@;
8 my $manifest = maniread();
9 my @pod = sort grep !/^inc/ && /\.(pm|pl|pod|PL)$/, keys %$manifest;
10 plan tests => scalar(@pod);
11 my @stopwords = qw/
12 API
13 Arnar
14 BMP
15 Blit
16 CGI
17 chromaticities
18 CMYK
19 CPAN
20 FreeType
21 GIF
22 HSV
23 Hrafnkelsson
24 ICO
25 IMAGER
26 Imager
27 Imager's
28 JPEG
29 POSIX
30 PNG
31 PNM
32 RGB
33 RGBA
34 SGI
35 sRGB
36 TGA
37 TIFF
38 UTF-8
39 Uncategorized
40 bilevel
41 const
42 dpi
43 eg
44 gaussian
45 ie
46 infix
47 invocant
48 metadata
49 paletted
50 postfix
51 preload
52 preloading
53 preloads
54 renderer
55 tuple
56 unary
57 unseekable
58 varargs
59 /;
60
61 local %Pod::Wordlist::Wordlist = %Pod::Wordlist::Wordlist;
62 for my $stop (@stopwords) {
63   $Pod::Wordlist::Wordlist{$stop} = 1;
64 }
65
66 # see for example:
67 #  https://bugs.launchpad.net/ubuntu/+source/aspell/+bug/71322
68 $ENV{LANG} = "C";
69 $ENV{LC_ALL} = "C";
70 for my $file (@pod) {
71   my $check_fh = File::Temp->new;
72   my $check_filename = $check_fh->filename;
73   open POD, "< $file"
74     or die "Cannot open $file for spell check: $!\n";
75   Pod::Spell->new->parse_from_filehandle(\*POD, $check_fh);
76   close $check_fh;
77   
78   my @out = `aspell list <$check_filename`;
79   unless (ok(@out == 0, "spell check $file")) {
80     chomp @out;
81     diag $_ for @out;
82     print "#----\n";
83     open my $fh, "<", $check_filename;
84     while (<$fh>) {
85       chomp;
86       print "# $_\n";
87     }
88     print "#----\n";
89   }
90 }