line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::File::IsSorted; |
2
|
|
|
|
|
|
|
$Test::File::IsSorted::VERSION = '0.2.0'; |
3
|
2
|
|
|
2
|
|
191219
|
use strict; |
|
2
|
|
|
|
|
26
|
|
|
2
|
|
|
|
|
59
|
|
4
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
61
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
9
|
use parent 'Test::Builder::Module'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
14
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
979
|
use List::Util 1.34 qw/ all /; |
|
2
|
|
|
|
|
54
|
|
|
2
|
|
|
|
|
180
|
|
9
|
2
|
|
|
2
|
|
823
|
use File::IsSorted (); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
119
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my $CLASS = __PACKAGE__; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub are_sorted |
14
|
|
|
|
|
|
|
{ |
15
|
1
|
|
|
1
|
1
|
19200
|
my ( $paths, $name ) = @_; |
16
|
1
|
|
|
|
|
4
|
local $Test::Builder::Level = $Test::Builder::Level + 1; |
17
|
|
|
|
|
|
|
|
18
|
2
|
|
|
2
|
|
13
|
no locale; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
13
|
|
19
|
1
|
|
|
|
|
10
|
return are_sorted2( [ sort @$paths ], $name ); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub are_sorted2 |
23
|
|
|
|
|
|
|
{ |
24
|
3
|
|
|
3
|
1
|
16496
|
my ( $paths, $name ) = @_; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# local $Test::Builder::Level = $Test::Builder::Level + 1; |
27
|
|
|
|
|
|
|
|
28
|
2
|
|
|
2
|
|
131
|
no locale; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
6
|
|
29
|
3
|
|
|
|
|
13
|
my $paths_text = join "\n", @$paths, ""; |
30
|
3
|
|
|
|
|
32
|
my $tb = $CLASS->builder; |
31
|
|
|
|
|
|
|
|
32
|
3
|
|
|
|
|
77
|
my $checker = File::IsSorted->new; |
33
|
2
|
|
|
2
|
|
19
|
open my $fh, '<', \$paths_text; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
13
|
|
|
3
|
|
|
|
|
166
|
|
34
|
3
|
|
|
|
|
1672
|
scalar( $checker->is_filehandle_sorted( { fh => $fh, } ) ); |
35
|
2
|
|
|
|
|
7
|
close($fh); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# $tb->plan(2); |
38
|
|
|
|
|
|
|
my $ok = $tb->ok( |
39
|
2
|
|
|
4
|
|
20
|
scalar( all { $checker->is_file_sorted( +{ path => $_ } ); } @$paths ), |
|
4
|
|
|
|
|
56
|
|
40
|
|
|
|
|
|
|
$name |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
|
43
|
2
|
|
|
|
|
862
|
return !$ok; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |