line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Compare::String; |
2
|
168
|
|
|
168
|
|
1166
|
use strict; |
|
168
|
|
|
|
|
302
|
|
|
168
|
|
|
|
|
4821
|
|
3
|
168
|
|
|
168
|
|
854
|
use warnings; |
|
168
|
|
|
|
|
322
|
|
|
168
|
|
|
|
|
4455
|
|
4
|
|
|
|
|
|
|
|
5
|
168
|
|
|
168
|
|
860
|
use Carp qw/confess/; |
|
168
|
|
|
|
|
301
|
|
|
168
|
|
|
|
|
6990
|
|
6
|
|
|
|
|
|
|
|
7
|
168
|
|
|
168
|
|
897
|
use base 'Test2::Compare::Base'; |
|
168
|
|
|
|
|
390
|
|
|
168
|
|
|
|
|
18354
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.000153'; |
10
|
|
|
|
|
|
|
|
11
|
168
|
|
|
168
|
|
1186
|
use Test2::Util::HashBase qw/input/; |
|
168
|
|
|
|
|
361
|
|
|
168
|
|
|
|
|
1257
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# Overloads '!' for us. |
14
|
168
|
|
|
168
|
|
22100
|
use Test2::Compare::Negatable; |
|
168
|
|
|
|
|
425
|
|
|
168
|
|
|
|
|
1101
|
|
15
|
|
|
|
|
|
|
|
16
|
63
|
|
|
63
|
0
|
151
|
sub stringify_got { 1 } |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub init { |
19
|
8688
|
|
|
8688
|
0
|
99767
|
my $self = shift; |
20
|
|
|
|
|
|
|
confess "input must be defined for 'String' check" |
21
|
8688
|
100
|
|
|
|
22842
|
unless defined $self->{+INPUT}; |
22
|
|
|
|
|
|
|
|
23
|
8687
|
|
|
|
|
23021
|
$self->SUPER::init(@_); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub name { |
27
|
89
|
|
|
89
|
1
|
395
|
my $self = shift; |
28
|
89
|
|
|
|
|
180
|
my $in = $self->{+INPUT}; |
29
|
89
|
|
|
|
|
235
|
return "$in"; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub operator { |
33
|
102
|
|
|
102
|
1
|
363
|
my $self = shift; |
34
|
|
|
|
|
|
|
|
35
|
102
|
100
|
|
|
|
255
|
return '' unless @_; |
36
|
79
|
|
|
|
|
146
|
my ($got) = @_; |
37
|
|
|
|
|
|
|
|
38
|
79
|
100
|
|
|
|
182
|
return '' unless defined($got); |
39
|
|
|
|
|
|
|
|
40
|
73
|
100
|
|
|
|
175
|
return 'ne' if $self->{+NEGATE}; |
41
|
70
|
|
|
|
|
176
|
return 'eq'; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub verify { |
45
|
10552
|
|
|
10552
|
1
|
16544
|
my $self = shift; |
46
|
10552
|
|
|
|
|
28677
|
my %params = @_; |
47
|
10552
|
|
|
|
|
21531
|
my ($got, $exists) = @params{qw/got exists/}; |
48
|
|
|
|
|
|
|
|
49
|
10552
|
100
|
|
|
|
19843
|
return 0 unless $exists; |
50
|
10530
|
100
|
|
|
|
17022
|
return 0 unless defined $got; |
51
|
|
|
|
|
|
|
|
52
|
10520
|
|
|
|
|
16371
|
my $input = $self->{+INPUT}; |
53
|
10520
|
|
|
|
|
14694
|
my $negate = $self->{+NEGATE}; |
54
|
|
|
|
|
|
|
|
55
|
10520
|
100
|
|
|
|
17434
|
return "$input" ne "$got" if $negate; |
56
|
10512
|
|
|
|
|
34355
|
return "$input" eq "$got"; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__END__ |