Apocalypse/DOSnewline.pm

filter: Statementstmt 61.5% 16 / 26 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 1 totaltotal 61.1% 22 / 36 CC 3 SCAR 15.4
CC
3
Cov
57%
do_test
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.7
« Apocalypse/AutoLoader.pm ↑ Summary Apocalypse/FileChecks.pm »
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 38 ▶use strict; use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
10 package Test::Apocalypse::DOSnewline;
11 38 $Test::Apocalypse::DOSnewline::VERSION = '1.006';
12 38 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
13 38 $Test::Apocalypse::DOSnewline::AUTHORITY = 'cpan:APOCAL';
14 }
15  
16 # ABSTRACT: Plugin to detect presence of DOS newlines
17  
18 38 ▶use Test::More;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 38 ▶use File::Find::Rule 0.32;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 # TODO If a win32 user downloads the tarball, it will have DOS newlines in it?
22 37 ▶sub _do_automated { 0 }
Subroutine _do_automated: called CC=1 SCAR=0.0
23  
24 0 ▶sub do_test {
Subroutine do_test: not called CC=3 SCAR=24.8
Pod undocumented
25 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;
33  
34 # test it!
35 0 ▶ if ( scalar @files ) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @files) { } 0 0 0
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 38 1;
48  
49 __END__
« Apocalypse/AutoLoader.pm ↑ Summary Apocalypse/FileChecks.pm »