line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Deep::ArrayEachNotEmpty; |
2
|
1
|
|
|
1
|
|
42142
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
4
|
use utf8; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
7
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
676
|
use parent qw/Test::Deep::ArrayEach/; |
|
1
|
|
|
|
|
314
|
|
|
1
|
|
|
|
|
5
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
2326
|
use Exporter qw/import/; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
274
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = "0.01"; |
11
|
|
|
|
|
|
|
our @EXPORT = qw/array_each_not_empty/; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub descend { |
14
|
2
|
|
|
2
|
0
|
14989
|
my ($self, $got) = @_; |
15
|
|
|
|
|
|
|
|
16
|
2
|
100
|
|
|
|
5
|
return if _is_empty_array($got); |
17
|
1
|
|
|
|
|
7
|
return $self->SUPER::descend($got); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub renderExp { |
21
|
1
|
|
|
1
|
0
|
4
|
my ($self, $exp) = @_; |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
6
|
return $self->SUPER::renderExp($exp) . ' with not empty'; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub renderGot { |
27
|
2
|
|
|
2
|
0
|
145
|
my ($self, $got) = @_; |
28
|
|
|
|
|
|
|
|
29
|
2
|
100
|
|
|
|
3
|
return 'Empty array' if _is_empty_array($got); |
30
|
1
|
|
|
|
|
4
|
return $self->SUPER::renderGot($got); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub _is_empty_array { |
34
|
4
|
|
|
4
|
|
6
|
my $value = shift; |
35
|
|
|
|
|
|
|
|
36
|
4
|
|
100
|
|
|
39
|
return ref $value eq 'ARRAY' && !@$value; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub array_each_not_empty { |
40
|
1
|
|
|
1
|
0
|
65
|
my $expect = shift; |
41
|
|
|
|
|
|
|
|
42
|
1
|
|
|
|
|
8
|
return Test::Deep::ArrayEachNotEmpty->new($expect); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
__END__ |