Test::PureASCII - Test that only ASCII characteres are used on your code
use Test::PureASCII; all_perl_files_are_pure_ascii();
or
use Test::PureASCII tests => $how_many; file_is_pure_ascii($filename1, "only ASCII in $filaname1"); file_is_pure_ascii($filename2, "only ASCII in $filaname2"); file_is_pure_ascii($filename3, "only ASCII in $filaname3"); ...
The usual pure-ASCII test looks like:
use Test::More; eval "use Test::PureASCII"; plan skip_all => "Test::PureASCII required" if $@; all_perl_files_are_pure_ascii();
This module allows to create tests to ensure that only 7-bit ASCII characters are used on Perl source files.
The following functions are exported by this module:
checks that $filename contains only ASCII characters.
$filename
The optional argument $test_name will be included on the output when reporting errors.
$test_name
find all the Perl source files contained in directories @dirs recursively and check that they only contain ASCII characters.
@dirs
blib is used as the default directory if none is given.
blib
find all the files (Perl and non-Perl) contained in directories @dirs recursively and check that they only contain ASCII characters.
The current directory is used as the default directory if none is given.
A nice table containing Unicode and Latin1 codes for common (at least in Europe) non-ASCII characters is available from http://www.alanwood.net/demos/ansi.html.
Salvador Fañdino, <sfandino@yahoo.com>
Copyright (C) 2008 by Qindel Formacion y Servicios S.L.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
This module contains code copied from Test::Pod Copyright (C) 2006 by Andy Lester.
To install Test::PureASCII, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::PureASCII
CPAN shell
perl -MCPAN -e shell install Test::PureASCII
For more information on module installation, please visit the detailed CPAN module installation guide.