line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Stream::Compare::Regex; |
2
|
100
|
|
|
100
|
|
642
|
use strict; |
|
100
|
|
|
|
|
110
|
|
|
100
|
|
|
|
|
2276
|
|
3
|
100
|
|
|
100
|
|
297
|
use warnings; |
|
100
|
|
|
|
|
110
|
|
|
100
|
|
|
|
|
1921
|
|
4
|
|
|
|
|
|
|
|
5
|
100
|
|
|
100
|
|
290
|
use base 'Test::Stream::Compare'; |
|
100
|
|
|
|
|
107
|
|
|
100
|
|
|
|
|
6041
|
|
6
|
100
|
|
|
100
|
|
389
|
use Test::Stream::HashBase accessors => [qw/input/]; |
|
100
|
|
|
|
|
116
|
|
|
100
|
|
|
|
|
553
|
|
7
|
|
|
|
|
|
|
|
8
|
100
|
|
|
100
|
|
412
|
use Test::Stream::Util qw/render_ref rtype/; |
|
100
|
|
|
|
|
123
|
|
|
100
|
|
|
|
|
499
|
|
9
|
100
|
|
|
100
|
|
387
|
use Scalar::Util qw/reftype refaddr/; |
|
100
|
|
|
|
|
121
|
|
|
100
|
|
|
|
|
4111
|
|
10
|
100
|
|
|
100
|
|
355
|
use Carp qw/croak/; |
|
100
|
|
|
|
|
110
|
|
|
100
|
|
|
|
|
19640
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub init { |
13
|
7
|
|
|
7
|
0
|
9
|
my $self = shift; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
croak "'input' is a required attribute" |
16
|
7
|
100
|
|
|
|
150
|
unless $self->{+INPUT}; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
croak "'input' must be a regex , got '" . $self->{+INPUT} . "'" |
19
|
6
|
100
|
|
|
|
14
|
unless rtype($self->{+INPUT}) eq 'REGEXP'; |
20
|
|
|
|
|
|
|
|
21
|
5
|
|
|
|
|
20
|
$self->SUPER::init(); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
2
|
|
|
2
|
0
|
8
|
sub stringify_got { 1 } |
25
|
|
|
|
|
|
|
|
26
|
3
|
|
|
3
|
1
|
9
|
sub operator { 'eq' } |
27
|
|
|
|
|
|
|
|
28
|
3
|
|
|
3
|
1
|
13
|
sub name { "" . $_[0]->{+INPUT} }; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub verify { |
31
|
11
|
|
|
11
|
1
|
17
|
my $self = shift; |
32
|
11
|
|
|
|
|
22
|
my %params = @_; |
33
|
11
|
|
|
|
|
14
|
my ($got, $exists) = @params{qw/got exists/}; |
34
|
|
|
|
|
|
|
|
35
|
11
|
100
|
|
|
|
24
|
return 0 unless $exists; |
36
|
|
|
|
|
|
|
|
37
|
10
|
|
|
|
|
11
|
my $in = $self->{+INPUT}; |
38
|
10
|
100
|
|
|
|
19
|
my $got_type = rtype($got) or return 0; |
39
|
|
|
|
|
|
|
|
40
|
8
|
100
|
|
|
|
18
|
return 0 unless $got_type eq 'REGEXP'; |
41
|
|
|
|
|
|
|
|
42
|
7
|
|
|
|
|
24
|
return "$in" eq "$got"; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |