line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Compare::String; |
2
|
169
|
|
|
169
|
|
1196
|
use strict; |
|
169
|
|
|
|
|
339
|
|
|
169
|
|
|
|
|
5251
|
|
3
|
169
|
|
|
169
|
|
863
|
use warnings; |
|
169
|
|
|
|
|
384
|
|
|
169
|
|
|
|
|
4492
|
|
4
|
|
|
|
|
|
|
|
5
|
169
|
|
|
169
|
|
874
|
use Carp qw/confess/; |
|
169
|
|
|
|
|
391
|
|
|
169
|
|
|
|
|
7319
|
|
6
|
|
|
|
|
|
|
|
7
|
169
|
|
|
169
|
|
923
|
use base 'Test2::Compare::Base'; |
|
169
|
|
|
|
|
364
|
|
|
169
|
|
|
|
|
19294
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.000156'; |
10
|
|
|
|
|
|
|
|
11
|
169
|
|
|
169
|
|
1211
|
use Test2::Util::HashBase qw/input/; |
|
169
|
|
|
|
|
523
|
|
|
169
|
|
|
|
|
1174
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# Overloads '!' for us. |
14
|
169
|
|
|
169
|
|
23685
|
use Test2::Compare::Negatable; |
|
169
|
|
|
|
|
395
|
|
|
169
|
|
|
|
|
1262
|
|
15
|
|
|
|
|
|
|
|
16
|
63
|
|
|
63
|
0
|
167
|
sub stringify_got { 1 } |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub init { |
19
|
8784
|
|
|
8784
|
0
|
107205
|
my $self = shift; |
20
|
|
|
|
|
|
|
confess "input must be defined for 'String' check" |
21
|
8784
|
100
|
|
|
|
24923
|
unless defined $self->{+INPUT}; |
22
|
|
|
|
|
|
|
|
23
|
8783
|
|
|
|
|
23573
|
$self->SUPER::init(@_); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub name { |
27
|
89
|
|
|
89
|
1
|
411
|
my $self = shift; |
28
|
89
|
|
|
|
|
171
|
my $in = $self->{+INPUT}; |
29
|
89
|
|
|
|
|
252
|
return "$in"; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub operator { |
33
|
102
|
|
|
102
|
1
|
381
|
my $self = shift; |
34
|
|
|
|
|
|
|
|
35
|
102
|
100
|
|
|
|
276
|
return '' unless @_; |
36
|
79
|
|
|
|
|
187
|
my ($got) = @_; |
37
|
|
|
|
|
|
|
|
38
|
79
|
100
|
|
|
|
173
|
return '' unless defined($got); |
39
|
|
|
|
|
|
|
|
40
|
73
|
100
|
|
|
|
249
|
return 'ne' if $self->{+NEGATE}; |
41
|
70
|
|
|
|
|
251
|
return 'eq'; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub verify { |
45
|
10768
|
|
|
10768
|
1
|
17403
|
my $self = shift; |
46
|
10768
|
|
|
|
|
31253
|
my %params = @_; |
47
|
10768
|
|
|
|
|
23137
|
my ($got, $exists) = @params{qw/got exists/}; |
48
|
|
|
|
|
|
|
|
49
|
10768
|
100
|
|
|
|
22227
|
return 0 unless $exists; |
50
|
10746
|
100
|
|
|
|
19435
|
return 0 unless defined $got; |
51
|
|
|
|
|
|
|
|
52
|
10736
|
|
|
|
|
18277
|
my $input = $self->{+INPUT}; |
53
|
10736
|
|
|
|
|
15880
|
my $negate = $self->{+NEGATE}; |
54
|
|
|
|
|
|
|
|
55
|
10736
|
100
|
|
|
|
19107
|
return "$input" ne "$got" if $negate; |
56
|
10728
|
|
|
|
|
37793
|
return "$input" eq "$got"; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__END__ |