line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Stream::Compare::Regex; |
2
|
100
|
|
|
100
|
|
1079
|
use strict; |
|
100
|
|
|
|
|
194
|
|
|
100
|
|
|
|
|
2633
|
|
3
|
100
|
|
|
100
|
|
503
|
use warnings; |
|
100
|
|
|
|
|
199
|
|
|
100
|
|
|
|
|
2456
|
|
4
|
|
|
|
|
|
|
|
5
|
100
|
|
|
100
|
|
561
|
use Test::Stream::Compare; |
|
100
|
|
|
|
|
196
|
|
|
100
|
|
|
|
|
683
|
|
6
|
|
|
|
|
|
|
use Test::Stream::HashBase( |
7
|
100
|
|
|
|
|
753
|
base => 'Test::Stream::Compare', |
8
|
|
|
|
|
|
|
accessors => [qw/input/], |
9
|
100
|
|
|
100
|
|
596
|
); |
|
100
|
|
|
|
|
204
|
|
10
|
|
|
|
|
|
|
|
11
|
100
|
|
|
100
|
|
566
|
use Test::Stream::Util qw/render_ref rtype/; |
|
100
|
|
|
|
|
191
|
|
|
100
|
|
|
|
|
665
|
|
12
|
100
|
|
|
100
|
|
543
|
use Scalar::Util qw/reftype refaddr/; |
|
100
|
|
|
|
|
208
|
|
|
100
|
|
|
|
|
5439
|
|
13
|
100
|
|
|
100
|
|
512
|
use Carp qw/croak/; |
|
100
|
|
|
|
|
205
|
|
|
100
|
|
|
|
|
29149
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub init { |
16
|
7
|
|
|
7
|
0
|
13
|
my $self = shift; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
croak "'input' is a required attribute" |
19
|
7
|
100
|
|
|
|
208
|
unless $self->{+INPUT}; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
croak "'input' must be a regex , got '" . $self->{+INPUT} . "'" |
22
|
6
|
100
|
|
|
|
25
|
unless rtype($self->{+INPUT}) eq 'REGEXP'; |
23
|
|
|
|
|
|
|
|
24
|
5
|
|
|
|
|
30
|
$self->SUPER::init(); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
2
|
|
|
2
|
0
|
7
|
sub stringify_got { 1 } |
28
|
|
|
|
|
|
|
|
29
|
3
|
|
|
3
|
1
|
11
|
sub operator { 'eq' } |
30
|
|
|
|
|
|
|
|
31
|
3
|
|
|
3
|
1
|
18
|
sub name { "" . $_[0]->{+INPUT} }; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub verify { |
34
|
11
|
|
|
11
|
1
|
28
|
my $self = shift; |
35
|
11
|
|
|
|
|
33
|
my %params = @_; |
36
|
11
|
|
|
|
|
38
|
my ($got, $exists) = @params{qw/got exists/}; |
37
|
|
|
|
|
|
|
|
38
|
11
|
100
|
|
|
|
29
|
return 0 unless $exists; |
39
|
|
|
|
|
|
|
|
40
|
10
|
|
|
|
|
19
|
my $in = $self->{+INPUT}; |
41
|
10
|
100
|
|
|
|
30
|
my $got_type = rtype($got) or return 0; |
42
|
|
|
|
|
|
|
|
43
|
8
|
100
|
|
|
|
27
|
return 0 unless $got_type eq 'REGEXP'; |
44
|
|
|
|
|
|
|
|
45
|
7
|
|
|
|
|
38
|
return "$in" eq "$got"; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |