]>
Commit | Line | Data |
---|---|---|
8294bf44 TC |
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/ | |
2c331f9f TC |
12 | API |
13 | Arnar | |
14 | BMP | |
15 | Blit | |
16 | CGI | |
fbc49dbe | 17 | chromaticities |
2c331f9f TC |
18 | CMYK |
19 | CPAN | |
20 | FreeType | |
21 | GIF | |
22 | HSV | |
23 | Hrafnkelsson | |
24 | ICO | |
25 | IMAGER | |
8294bf44 TC |
26 | Imager |
27 | Imager's | |
8294bf44 | 28 | JPEG |
6d5c85a2 | 29 | POSIX |
8294bf44 | 30 | PNG |
2c331f9f TC |
31 | PNM |
32 | RGB | |
33 | RGBA | |
8294bf44 | 34 | SGI |
fbc49dbe | 35 | sRGB |
8294bf44 | 36 | TGA |
2c331f9f TC |
37 | TIFF |
38 | UTF-8 | |
39 | Uncategorized | |
8294bf44 | 40 | bilevel |
2c331f9f | 41 | const |
8294bf44 | 42 | dpi |
8294bf44 | 43 | eg |
67d441b2 | 44 | gaussian |
8294bf44 | 45 | ie |
8294bf44 | 46 | infix |
c18dd26e | 47 | invocant |
2c331f9f | 48 | metadata |
abffffed | 49 | multi-threaded |
24c9233d | 50 | mutex |
2c331f9f TC |
51 | paletted |
52 | postfix | |
53 | preload | |
54 | preloading | |
55 | preloads | |
130225b1 | 56 | renderer |
d2549cc4 | 57 | tuple |
2c331f9f | 58 | unary |
9d5ff8a6 | 59 | unseekable |
2c331f9f | 60 | varargs |
8294bf44 TC |
61 | /; |
62 | ||
63 | local %Pod::Wordlist::Wordlist = %Pod::Wordlist::Wordlist; | |
64 | for my $stop (@stopwords) { | |
65 | $Pod::Wordlist::Wordlist{$stop} = 1; | |
66 | } | |
67 | ||
68 | # see for example: | |
69 | # https://bugs.launchpad.net/ubuntu/+source/aspell/+bug/71322 | |
70 | $ENV{LANG} = "C"; | |
71 | $ENV{LC_ALL} = "C"; | |
72 | for my $file (@pod) { | |
73 | my $check_fh = File::Temp->new; | |
74 | my $check_filename = $check_fh->filename; | |
75 | open POD, "< $file" | |
76 | or die "Cannot open $file for spell check: $!\n"; | |
77 | Pod::Spell->new->parse_from_filehandle(\*POD, $check_fh); | |
78 | close $check_fh; | |
79 | ||
80 | my @out = `aspell list <$check_filename`; | |
81 | unless (ok(@out == 0, "spell check $file")) { | |
82 | chomp @out; | |
125e8835 | 83 | diag $_ for @out; |
8294bf44 TC |
84 | print "#----\n"; |
85 | open my $fh, "<", $check_filename; | |
86 | while (<$fh>) { | |
87 | chomp; | |
88 | print "# $_\n"; | |
89 | } | |
90 | print "#----\n"; | |
91 | } | |
92 | } |