]> git.imager.perl.org - imager.git/blame - t/x20spell.t
also check individual files get version bumps on changes
[imager.git] / t / x20spell.t
CommitLineData
8294bf44
TC
1#!perl -w
2use strict;
3use Test::More;
4use ExtUtils::Manifest qw(maniread);
5use File::Temp;
6eval "use Pod::Spell 1.01";
7plan skip_all => "Pod::Spell 1.01 required for spellchecking POD" if $@;
8my $manifest = maniread();
9my @pod = sort grep !/^inc/ && /\.(pm|pl|pod|PL)$/, keys %$manifest;
10plan tests => scalar(@pod);
11my @stopwords = qw/
2c331f9f
TC
12API
13Arnar
14BMP
15Blit
16CGI
fbc49dbe 17chromaticities
2c331f9f
TC
18CMYK
19CPAN
20FreeType
21GIF
22HSV
23Hrafnkelsson
24ICO
25IMAGER
8294bf44
TC
26Imager
27Imager's
8294bf44 28JPEG
6d5c85a2 29POSIX
8294bf44 30PNG
2c331f9f
TC
31PNM
32RGB
33RGBA
8294bf44 34SGI
fbc49dbe 35sRGB
8294bf44 36TGA
2c331f9f
TC
37TIFF
38UTF-8
39Uncategorized
8294bf44 40bilevel
2c331f9f 41const
8294bf44 42dpi
8294bf44 43eg
67d441b2 44gaussian
8294bf44 45ie
8294bf44 46infix
c18dd26e 47invocant
2c331f9f 48metadata
abffffed 49multi-threaded
24c9233d 50mutex
2c331f9f
TC
51paletted
52postfix
53preload
54preloading
55preloads
130225b1 56renderer
d2549cc4 57tuple
2c331f9f 58unary
9d5ff8a6 59unseekable
2c331f9f 60varargs
8294bf44
TC
61/;
62
63local %Pod::Wordlist::Wordlist = %Pod::Wordlist::Wordlist;
64for 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";
72for 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}