line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
12
|
|
|
12
|
|
560
|
use 5.006; |
|
12
|
|
|
|
|
31
|
|
2
|
12
|
|
|
12
|
|
48
|
use strict; |
|
12
|
|
|
|
|
16
|
|
|
12
|
|
|
|
|
222
|
|
3
|
12
|
|
|
12
|
|
37
|
use warnings; |
|
12
|
|
|
|
|
16
|
|
|
12
|
|
|
|
|
747
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Test::File::ShareDir::Utils; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '1.001002'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# ABSTRACT: Simple utilities for File::ShareDir testing |
12
|
|
|
|
|
|
|
|
13
|
12
|
|
|
12
|
|
52
|
use Exporter 5.57 qw(import); |
|
12
|
|
|
|
|
202
|
|
|
12
|
|
|
|
|
439
|
|
14
|
12
|
|
|
12
|
|
50
|
use Carp qw( croak ); |
|
12
|
|
|
|
|
15
|
|
|
12
|
|
|
|
|
2825
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our @EXPORT_OK = qw( extract_dashes ); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub extract_dashes { |
42
|
5
|
|
|
5
|
1
|
2042
|
my ( $undashed_to, $source ) = @_; |
43
|
5
|
50
|
33
|
|
|
58
|
if ( not ref $source or 'HASH' ne ref $source ) { |
44
|
0
|
|
|
|
|
0
|
return croak(q[Must pass a hashref]); |
45
|
|
|
|
|
|
|
} |
46
|
5
|
|
|
|
|
10
|
my %input_config = %{$source}; |
|
5
|
|
|
|
|
25
|
|
47
|
5
|
|
|
|
|
12
|
my $params = {}; |
48
|
5
|
|
|
|
|
18
|
for my $key ( keys %input_config ) { |
49
|
7
|
100
|
|
|
|
32
|
next unless $key =~ /\A-(.*)\z/msx; |
50
|
2
|
|
|
|
|
10
|
$params->{$1} = delete $input_config{$key}; |
51
|
|
|
|
|
|
|
} |
52
|
5
|
50
|
|
|
|
24
|
$params->{$undashed_to} = {} if not exists $params->{$undashed_to}; |
53
|
5
|
|
|
|
|
12
|
for my $key ( keys %input_config ) { |
54
|
5
|
|
|
|
|
14
|
$params->{$undashed_to}->{$key} = $input_config{$key}; |
55
|
|
|
|
|
|
|
} |
56
|
5
|
|
|
|
|
46
|
return $params; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__END__ |