line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Stream::Compare::Regex; |
2
|
100
|
|
|
100
|
|
1062
|
use strict; |
|
100
|
|
|
|
|
188
|
|
|
100
|
|
|
|
|
2542
|
|
3
|
100
|
|
|
100
|
|
507
|
use warnings; |
|
100
|
|
|
|
|
197
|
|
|
100
|
|
|
|
|
2832
|
|
4
|
|
|
|
|
|
|
|
5
|
100
|
|
|
100
|
|
521
|
use Test::Stream::Compare; |
|
100
|
|
|
|
|
188
|
|
|
100
|
|
|
|
|
686
|
|
6
|
|
|
|
|
|
|
use Test::Stream::HashBase( |
7
|
100
|
|
|
|
|
765
|
base => 'Test::Stream::Compare', |
8
|
|
|
|
|
|
|
accessors => [qw/input/], |
9
|
100
|
|
|
100
|
|
532
|
); |
|
100
|
|
|
|
|
199
|
|
10
|
|
|
|
|
|
|
|
11
|
100
|
|
|
100
|
|
564
|
use Test::Stream::Util qw/render_ref rtype/; |
|
100
|
|
|
|
|
194
|
|
|
100
|
|
|
|
|
664
|
|
12
|
100
|
|
|
100
|
|
589
|
use Scalar::Util qw/reftype refaddr/; |
|
100
|
|
|
|
|
199
|
|
|
100
|
|
|
|
|
5311
|
|
13
|
100
|
|
|
100
|
|
504
|
use Carp qw/croak/; |
|
100
|
|
|
|
|
214
|
|
|
100
|
|
|
|
|
28691
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub init { |
16
|
7
|
|
|
7
|
0
|
13
|
my $self = shift; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
croak "'input' is a required attribute" |
19
|
7
|
100
|
|
|
|
211
|
unless $self->{+INPUT}; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
croak "'input' must be a regex , got '" . $self->{+INPUT} . "'" |
22
|
6
|
100
|
|
|
|
26
|
unless rtype($self->{+INPUT}) eq 'REGEXP'; |
23
|
|
|
|
|
|
|
|
24
|
5
|
|
|
|
|
34
|
$self->SUPER::init(); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
2
|
|
|
2
|
0
|
8
|
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
|
27
|
my $self = shift; |
35
|
11
|
|
|
|
|
33
|
my %params = @_; |
36
|
11
|
|
|
|
|
22
|
my ($got, $exists) = @params{qw/got exists/}; |
37
|
|
|
|
|
|
|
|
38
|
11
|
100
|
|
|
|
32
|
return 0 unless $exists; |
39
|
|
|
|
|
|
|
|
40
|
10
|
|
|
|
|
19
|
my $in = $self->{+INPUT}; |
41
|
10
|
100
|
|
|
|
37
|
my $got_type = rtype($got) or return 0; |
42
|
|
|
|
|
|
|
|
43
|
8
|
100
|
|
|
|
29
|
return 0 unless $got_type eq 'REGEXP'; |
44
|
|
|
|
|
|
|
|
45
|
7
|
|
|
|
|
43
|
return "$in" eq "$got"; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |