File Coverage

blib/lib/Test/Apocalypse/DOSnewline.pm
Criterion Covered Total %
statement 14 24 58.3
branch 0 2 0.0
condition n/a
subroutine 6 7 85.7
pod 0 1 0.0
total 20 34 58.8


line stmt bran cond sub pod time code
1             #
2             # This file is part of Test-Apocalypse
3             #
4             # This software is copyright (c) 2014 by Apocalypse.
5             #
6             # This is free software; you can redistribute it and/or modify it under
7             # the same terms as the Perl 5 programming language system itself.
8             #
9 39     39   15839322 use strict; use warnings;
  39     39   86  
  39         1664  
  39         156  
  39         77  
  39         2232  
10             package Test::Apocalypse::DOSnewline;
11             $Test::Apocalypse::DOSnewline::VERSION = '1.003';
12             BEGIN {
13 39     39   863 $Test::Apocalypse::DOSnewline::AUTHORITY = 'cpan:APOCAL';
14             }
15              
16             # ABSTRACT: Plugin to detect presence of DOS newlines
17              
18 39     39   162 use Test::More;
  39         159  
  39         416  
19 39     39   37513 use File::Find::Rule 0.32;
  39         272747  
  39         238  
20              
21             # TODO If a win32 user downloads the tarball, it will have DOS newlines in it?
22 38     38   190 sub _do_automated { 0 }
23              
24             sub do_test {
25 0     0 0   plan tests => 1;
26              
27             # generate the file list
28 0           my @files = File::Find::Rule->grep( qr/\r\n/ )->in( '.' );
29              
30             # for now, we skip SVN + git stuff
31             # also skip any tarballs
32 0           @files = grep { $_ !~ /(?:\.svn\/|\.git\/|tar(?:\.gz|\.bz2)?|tgz|zip)/ } @files;
  0            
33              
34             # test it!
35 0 0         if ( scalar @files ) {
36 0           fail( 'DOS-style newline detected in the distribution' );
37 0           foreach my $f ( @files ) {
38 0           diag( "DOS-style newline found in: $f" );
39             }
40             } else {
41 0           pass( 'No files have DOS-style newline in it' );
42             }
43              
44 0           return;
45             }
46              
47             1;
48              
49             __END__
50              
51             =pod
52              
53             =encoding UTF-8
54              
55             =for :stopwords Apocalypse Niebur Ryan dist
56              
57             =for Pod::Coverage do_test
58              
59             =head1 NAME
60              
61             Test::Apocalypse::DOSnewline - Plugin to detect presence of DOS newlines
62              
63             =head1 VERSION
64              
65             This document describes v1.003 of Test::Apocalypse::DOSnewline - released October 24, 2014 as part of Test-Apocalypse.
66              
67             =head1 DESCRIPTION
68              
69             This plugin detects the presence of DOS newlines in the dist.
70              
71             =head1 SEE ALSO
72              
73             Please see those modules/websites for more information related to this module.
74              
75             =over 4
76              
77             =item *
78              
79             L<Test::Apocalypse|Test::Apocalypse>
80              
81             =back
82              
83             =head1 AUTHOR
84              
85             Apocalypse <APOCAL@cpan.org>
86              
87             =head1 COPYRIGHT AND LICENSE
88              
89             This software is copyright (c) 2014 by Apocalypse.
90              
91             This is free software; you can redistribute it and/or modify it under
92             the same terms as the Perl 5 programming language system itself.
93              
94             The full text of the license can be found in the
95             F<LICENSE> file included with this distribution.
96              
97             =head1 DISCLAIMER OF WARRANTY
98              
99             THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
100             APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
101             HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
102             OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
103             THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
104             PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
105             IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
106             ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
107              
108             IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
109             WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
110             THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
111             GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
112             USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
113             DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
114             PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
115             EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
116             SUCH DAMAGES.
117              
118             =cut