.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Test::EOL 3pm" .TH Test::EOL 3pm "2017-08-04" "perl v5.26.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Test::EOL \- Check the correct line endings in your project .SH "VERSION" .IX Header "VERSION" version 2.00 .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\f(CW\*(C`Test::EOL\*(C'\fR lets you check for the presence of trailing whitespace and/or windows line endings in your perl code. It reports its results in standard \&\f(CW\*(C`Test::Simple\*(C'\fR fashion: .PP .Vb 2 \& use Test::EOL tests => 1; \& eol_unix_ok( \*(Aqlib/Module.pm\*(Aq, \*(AqModule is ^M free\*(Aq); .Ve .PP and to add checks for trailing whitespace: .PP .Vb 2 \& use Test::EOL tests => 1; \& eol_unix_ok( \*(Aqlib/Module.pm\*(Aq, \*(AqModule is ^M and trailing whitespace free\*(Aq, { trailing_whitespace => 1 }); .Ve .PP Module authors can include the following in a t/eol.t and have \f(CW\*(C`Test::EOL\*(C'\fR automatically find and check all perl files in a module distribution: .PP .Vb 2 \& use Test::EOL; \& all_perl_files_ok(); .Ve .PP or .PP .Vb 2 \& use Test::EOL; \& all_perl_files_ok( @mydirs ); .Ve .PP and if authors would like to check for trailing whitespace: .PP .Vb 2 \& use Test::EOL; \& all_perl_files_ok({ trailing_whitespace => 1 }); .Ve .PP or .PP .Vb 2 \& use Test::EOL; \& all_perl_files_ok({ trailing_whitespace => 1 }, @mydirs ); .Ve .PP or .PP .Vb 4 \& use Test::More; \& use Test::EOL \*(Aqno_test\*(Aq; \& all_perl_files_ok(); \& done_testing; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module scans your project/distribution for any perl files (scripts, modules, etc) for the presence of windows line endings. .SH "FUNCTIONS" .IX Header "FUNCTIONS" .SS "all_perl_files_ok" .IX Subsection "all_perl_files_ok" .Vb 1 \& all_perl_files_ok( [ \e%options ], [ @directories ] ) .Ve .PP Applies \f(CW\*(C`eol_unix_ok()\*(C'\fR to all perl files found in \f(CW@directories\fR (and sub directories). If no <@directories> is given, the starting point is the current working directory, as tests are usually run from the top directory in a typical \&\s-1CPAN\s0 distribution. A perl file is *.pl or *.pm or *.pod or *.t or a file starting with \f(CW\*(C`#!...perl\*(C'\fR .PP Valid \f(CW\*(C`\e%options\*(C'\fR currently are: .IP "\(bu" 4 trailing_whitespace .Sp By default Test::EOL only looks for Windows (\s-1CR/LF\s0) line-endings. Set this to true to raise errors if any kind of trailing whitespace is present in the file. .IP "\(bu" 4 all_reasons .Sp Normally Test::EOL reports only the first error in every file (given that a text file originated on Windows will fail every single line). Set this a true value to register a test failure for every line with an error. .PP If the test plan is defined: .PP .Vb 2 \& use Test::EOL tests => 3; \& all_perl_files_ok(); .Ve .PP the total number of files tested must be specified. .SS "eol_unix_ok" .IX Subsection "eol_unix_ok" .Vb 1 \& eol_unix_ok ( $file [, $text] [, \e%options ] ) .Ve .PP Run a unix \s-1EOL\s0 check on \f(CW$file\fR. For a module, the path (lib/My/Module.pm) or the name (My::Module) can be both used. \f(CW$text\fR is the diagnostic label emitted after the \f(CW\*(C`ok\*(C'\fR/\f(CW\*(C`not ok\*(C'\fR \s-1TAP\s0 output. \f(CW\*(C`\e%options\*(C'\fR takes the same values as described in \&\*(L"all_perl_files_ok\*(R". .SH "EXPORT" .IX Header "EXPORT" A list of functions that can be exported. You can delete this section if you don't export anything, such as for a purely object-oriented module. .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" Shamelessly ripped off from Test::NoTabs. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "\(bu" 4 Test::More .IP "\(bu" 4 Test::Pod .IP "\(bu" 4 Test::Distribution .IP "\(bu" 4 .IP "\(bu" 4 Test::NoTabs .IP "\(bu" 4 Module::Install::AuthorTests .SH "SUPPORT" .IX Header "SUPPORT" Bugs may be submitted through the \s-1RT\s0 bug tracker (or bug\-Test\-EOL@rt.cpan.org ). .PP There is also a mailing list available for users of this distribution, at . .PP There is also an irc channel available for users of this distribution, at \&\f(CW\*(C`#perl\*(C'\fR on \f(CW\*(C`irc.perl.org\*(C'\fR . .SH "AUTHOR" .IX Header "AUTHOR" Tomas Doran (t0m) .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" .IP "\(bu" 4 Karen Etheridge .IP "\(bu" 4 Olivier Mengué .IP "\(bu" 4 Peter Rabbitson .IP "\(bu" 4 Florian Ragwitz .IP "\(bu" 4 Dagfinn Ilmari MannsÄker .IP "\(bu" 4 Arthur Axel 'fREW' Schmidt .IP "\(bu" 4 Kent Fredric .SH "COPYRIGHT AND LICENCE" .IX Header "COPYRIGHT AND LICENCE" This software is copyright (c) 2009 by Tomas Doran. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.