line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Stream::Compare::String; |
2
|
100
|
|
|
100
|
|
665
|
use strict; |
|
100
|
|
|
|
|
164
|
|
|
100
|
|
|
|
|
2250
|
|
3
|
100
|
|
|
100
|
|
304
|
use warnings; |
|
100
|
|
|
|
|
111
|
|
|
100
|
|
|
|
|
2091
|
|
4
|
|
|
|
|
|
|
|
5
|
100
|
|
|
100
|
|
296
|
use Carp qw/confess/; |
|
100
|
|
|
|
|
120
|
|
|
100
|
|
|
|
|
3639
|
|
6
|
|
|
|
|
|
|
|
7
|
100
|
|
|
100
|
|
322
|
use base 'Test::Stream::Compare'; |
|
100
|
|
|
|
|
108
|
|
|
100
|
|
|
|
|
6081
|
|
8
|
100
|
|
|
100
|
|
389
|
use Test::Stream::HashBase accessors => [qw/input negate/]; |
|
100
|
|
|
|
|
125
|
|
|
100
|
|
|
|
|
579
|
|
9
|
|
|
|
|
|
|
|
10
|
55
|
|
|
55
|
0
|
121
|
sub stringify_got { 1 } |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub init { |
13
|
3929
|
|
|
3929
|
0
|
3239
|
my $self = shift; |
14
|
|
|
|
|
|
|
confess "input must be defined for 'String' check" |
15
|
3929
|
100
|
|
|
|
6905
|
unless defined $self->{+INPUT}; |
16
|
|
|
|
|
|
|
|
17
|
3928
|
|
|
|
|
8041
|
$self->SUPER::init(@_); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub name { |
21
|
72
|
|
|
72
|
1
|
62
|
my $self = shift; |
22
|
72
|
|
|
|
|
79
|
my $in = $self->{+INPUT}; |
23
|
72
|
|
|
|
|
143
|
return "$in"; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub operator { |
27
|
85
|
|
|
85
|
1
|
80
|
my $self = shift; |
28
|
|
|
|
|
|
|
|
29
|
85
|
100
|
|
|
|
149
|
return '' unless @_; |
30
|
72
|
|
|
|
|
70
|
my ($got) = @_; |
31
|
|
|
|
|
|
|
|
32
|
72
|
100
|
|
|
|
117
|
return '' unless defined($got); |
33
|
|
|
|
|
|
|
|
34
|
65
|
100
|
|
|
|
112
|
return 'ne' if $self->{+NEGATE}; |
35
|
63
|
|
|
|
|
119
|
return 'eq'; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub verify { |
39
|
3925
|
|
|
3925
|
1
|
3327
|
my $self = shift; |
40
|
3925
|
|
|
|
|
6568
|
my %params = @_; |
41
|
3925
|
|
|
|
|
4851
|
my ($got, $exists) = @params{qw/got exists/}; |
42
|
|
|
|
|
|
|
|
43
|
3925
|
100
|
|
|
|
5349
|
return 0 unless $exists; |
44
|
3908
|
100
|
|
|
|
4795
|
return 0 unless defined $got; |
45
|
|
|
|
|
|
|
|
46
|
3898
|
|
|
|
|
3543
|
my $input = $self->{+INPUT}; |
47
|
3898
|
|
|
|
|
3173
|
my $negate = $self->{+NEGATE}; |
48
|
|
|
|
|
|
|
|
49
|
3898
|
100
|
|
|
|
5050
|
return "$input" ne "$got" if $negate; |
50
|
3892
|
|
|
|
|
10531
|
return "$input" eq "$got"; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |