File Coverage

blib/lib/Test/File/IsSorted.pm
Criterion Covered Total %
statement 20 20 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod 1 1 100.0
total 28 28 100.0


line stmt bran cond sub pod time code
1             package Test::File::IsSorted;
2             $Test::File::IsSorted::VERSION = '0.0.5';
3 1     1   106328 use strict;
  1         11  
  1         30  
4 1     1   5 use warnings;
  1         2  
  1         27  
5              
6 1     1   5 use parent 'Test::Builder::Module';
  1         2  
  1         6  
7              
8 1     1   915 use List::Util qw/ all /;
  1         2  
  1         95  
9 1     1   419 use File::IsSorted ();
  1         3  
  1         112  
10              
11             my $CLASS = __PACKAGE__;
12              
13             sub are_sorted
14             {
15 1     1 1 19299 my ( $paths, $name ) = @_;
16              
17 1         10 my $tb = $CLASS->builder;
18              
19 1         22 my $checker = File::IsSorted->new;
20             return $tb->ok(
21             scalar(
22 2     2   20 all { $checker->is_file_sorted( +{ path => $_ } ); }
23 1         50 @$paths
24             ),
25             $name
26             );
27             }
28              
29             1;
30              
31             __END__