d7ba2fe53ff00482320e82efb1bb05202e5d99a1
[catagits/Test-EOL.git] / README
1 NAME
2     Test::EOL - Check the correct line endings in your project
3
4 SYNOPSIS
5     "Test::EOL" lets you check the presence of windows line endings in your
6     perl code. It report its results in standard "Test::Simple" fashion:
7
8       use Test::EOL tests => 1;
9       eol_unix_ok( 'lib/Module.pm', 'Module is ^M free');
10
11     and to add checks for trailing whitespace:
12
13       use Test::EOL tests => 1;
14       eol_unix_ok( 'lib/Module.pm', 'Module is ^M and trailing whitespace free', { trailing_whitespace => 1 });
15
16     Module authors can include the following in a t/eol.t and have
17     "Test::EOL" automatically find and check all perl files in a module
18     distribution:
19
20       use Test::EOL;
21       all_perl_files_ok();
22
23     or
24
25       use Test::EOL;
26       all_perl_files_ok( @mydirs );
27
28     and if authors would like to check for trailing whitespace:
29
30       use Test::EOL;
31       all_perl_files_ok({ trailing_whitespace => 1 });
32
33     or
34
35       use Test::EOL;
36       all_perl_files_ok({ trailing_whitespace => 1 }, @mydirs );
37
38 DESCRIPTION
39     This module scans your project/distribution for any perl files (scripts,
40     modules, etc) for the presence of windows line endings.
41
42 EXPORT
43     A list of functions that can be exported. You can delete this section if
44     you don't export anything, such as for a purely object-oriented module.
45
46 FUNCTIONS
47   all_perl_files_ok( [ \%options ], [ @directories ] )
48     Applies "eol_unix_ok()" to all perl files found in @directories (and sub
49     directories). If no <@directories> is given, the starting point is one
50     level above the current running script, that should cover all the files
51     of a typical CPAN distribution. A perl file is *.pl or *.pm or *.t or a
52     file starting with "#!...perl"
53
54     If the test plan is defined:
55
56       use Test::EOL tests => 3;
57       all_perl_files_ok();
58
59     the total number of files tested must be specified.
60
61   eol_unix_ok( $file [, $text] [, \%options ]  )
62     Run a unix EOL check on $file. For a module, the path (lib/My/Module.pm)
63     or the name (My::Module) can be both used.
64
65 AUTHOR
66     Tomas Doran (t0m) "<bobtfish@bobtfish.net>"
67
68 BUGS
69     Testing for EOL styles other than unix (\n) currently unsupported.
70
71     The source code can be found on github, as listed in " META.yml ",
72     patches are welcome.
73
74     Otherwise please report any bugs or feature requests to "bug-test-eol at
75     rt.cpan.org", or through the web interface at
76     <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-EOL>. I will be
77     notified, and then you'll automatically be notified of progress on your
78     bug as I make changes.
79
80 ACKNOWLEDGEMENTS
81     Shamelessly ripped off from Test::NoTabs.
82
83 SEE ALSO
84     Test::More, Test::Pod. Test::Distribution, <Test:NoWarnings>,
85     Test::NoTabs, Module::Install::AuthorTests.
86
87 COPYRIGHT & LICENSE
88     Copyright 2009 Tomas Doran, some rights reserved.
89
90     This program is free software; you can redistribute it and/or modify it
91     under the same terms as Perl itself.
92