1Test::EOL(3) User Contributed Perl Documentation Test::EOL(3)
2
3
4
6 Test::EOL - Check the correct line endings in your project
7
9 "Test::EOL" lets you check the presence of windows line endings in your
10 perl code. It report its results in standard "Test::Simple" fashion:
11
12 use Test::EOL tests => 1;
13 eol_unix_ok( 'lib/Module.pm', 'Module is ^M free');
14
15 and to add checks for trailing whitespace:
16
17 use Test::EOL tests => 1;
18 eol_unix_ok( 'lib/Module.pm', 'Module is ^M and trailing whitespace free', { trailing_whitespace => 1 });
19
20 Module authors can include the following in a t/eol.t and have
21 "Test::EOL" automatically find and check all perl files in a module
22 distribution:
23
24 use Test::EOL;
25 all_perl_files_ok();
26
27 or
28
29 use Test::EOL;
30 all_perl_files_ok( @mydirs );
31
32 and if authors would like to check for trailing whitespace:
33
34 use Test::EOL;
35 all_perl_files_ok({ trailing_whitespace => 1 });
36
37 or
38
39 use Test::EOL;
40 all_perl_files_ok({ trailing_whitespace => 1 }, @mydirs );
41
43 This module scans your project/distribution for any perl files
44 (scripts, modules, etc) for the presence of windows line endings.
45
47 all_perl_files_ok( [ \%options ], [ @directories ] )
48 Applies "eol_unix_ok()" to all perl files found in @directories (and
49 sub directories). If no <@directories> is given, the starting point is
50 one level above the current running script, that should cover all the
51 files of a typical CPAN distribution. A perl file is *.pl or *.pm or
52 *.t or a 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
63 (lib/My/Module.pm) or the name (My::Module) can be both used.
64
66 A list of functions that can be exported. You can delete this section
67 if you don't export anything, such as for a purely object-oriented
68 module.
69
71 Shamelessly ripped off from Test::NoTabs.
72
74 Test::More, Test::Pod. Test::Distribution, <Test:NoWarnings>,
75 Test::NoTabs, Module::Install::AuthorTests.
76
78 · Tomas Doran <bobtfish@bobtfish.net>
79
80 · Arthur Axel 'fREW' Schmidt <frioux@gmail.com>
81
82 · Kent Fredric <kentfredric@gmail.com>
83
84 · Florian Ragwitz <rafl@debian.org>
85
87 This software is copyright (c) 2010 by Tomas Doran.
88
89 This is free software; you can redistribute it and/or modify it under
90 the same terms as the Perl 5 programming language system itself.
91
92
93
94perl v5.12.2 2010-10-18 Test::EOL(3)