line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Compare::Isa; |
2
|
169
|
|
|
169
|
|
1155
|
use strict; |
|
169
|
|
|
|
|
332
|
|
|
169
|
|
|
|
|
4877
|
|
3
|
169
|
|
|
169
|
|
876
|
use warnings; |
|
169
|
|
|
|
|
448
|
|
|
169
|
|
|
|
|
4280
|
|
4
|
|
|
|
|
|
|
|
5
|
169
|
|
|
169
|
|
840
|
use Carp qw/confess/; |
|
169
|
|
|
|
|
328
|
|
|
169
|
|
|
|
|
7448
|
|
6
|
169
|
|
|
169
|
|
952
|
use Scalar::Util qw/blessed/; |
|
169
|
|
|
|
|
365
|
|
|
169
|
|
|
|
|
6607
|
|
7
|
|
|
|
|
|
|
|
8
|
169
|
|
|
169
|
|
993
|
use base 'Test2::Compare::Base'; |
|
169
|
|
|
|
|
314
|
|
|
169
|
|
|
|
|
19375
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.000156'; |
11
|
|
|
|
|
|
|
|
12
|
169
|
|
|
169
|
|
1256
|
use Test2::Util::HashBase qw/input/; |
|
169
|
|
|
|
|
327
|
|
|
169
|
|
|
|
|
1109
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# Overloads '!' for us. |
15
|
169
|
|
|
169
|
|
24191
|
use Test2::Compare::Negatable; |
|
169
|
|
|
|
|
345
|
|
|
169
|
|
|
|
|
1079
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub init { |
18
|
10
|
|
|
10
|
0
|
321
|
my $self = shift; |
19
|
|
|
|
|
|
|
confess "input must be defined for 'Isa' check" |
20
|
10
|
100
|
|
|
|
489
|
unless defined $self->{+INPUT}; |
21
|
|
|
|
|
|
|
|
22
|
9
|
|
|
|
|
51
|
$self->SUPER::init(@_); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub name { |
26
|
7
|
|
|
7
|
1
|
310
|
my $self = shift; |
27
|
7
|
|
|
|
|
17
|
my $in = $self->{+INPUT}; |
28
|
7
|
|
|
|
|
35
|
return "$in"; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub operator { |
32
|
7
|
|
|
7
|
1
|
253
|
my $self = shift; |
33
|
7
|
100
|
|
|
|
29
|
return '!isa' if $self->{+NEGATE}; |
34
|
4
|
|
|
|
|
18
|
return 'isa'; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub verify { |
38
|
33
|
|
|
33
|
1
|
286
|
my $self = shift; |
39
|
33
|
|
|
|
|
93
|
my %params = @_; |
40
|
33
|
|
|
|
|
83
|
my ($got, $exists) = @params{qw/got exists/}; |
41
|
|
|
|
|
|
|
|
42
|
33
|
100
|
|
|
|
102
|
return 0 unless $exists; |
43
|
|
|
|
|
|
|
|
44
|
30
|
|
|
|
|
66
|
my $input = $self->{+INPUT}; |
45
|
30
|
|
|
|
|
302
|
my $negate = $self->{+NEGATE}; |
46
|
30
|
|
100
|
|
|
251
|
my $isa = blessed($got) && $got->isa($input); |
47
|
|
|
|
|
|
|
|
48
|
30
|
100
|
|
|
|
269
|
return !$isa if $negate; |
49
|
21
|
|
|
|
|
96
|
return $isa; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |