line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Compare::Isa; |
2
|
169
|
|
|
169
|
|
1110
|
use strict; |
|
169
|
|
|
|
|
329
|
|
|
169
|
|
|
|
|
4841
|
|
3
|
169
|
|
|
169
|
|
835
|
use warnings; |
|
169
|
|
|
|
|
335
|
|
|
169
|
|
|
|
|
4371
|
|
4
|
|
|
|
|
|
|
|
5
|
169
|
|
|
169
|
|
871
|
use Carp qw/confess/; |
|
169
|
|
|
|
|
353
|
|
|
169
|
|
|
|
|
7503
|
|
6
|
169
|
|
|
169
|
|
925
|
use Scalar::Util qw/blessed/; |
|
169
|
|
|
|
|
348
|
|
|
169
|
|
|
|
|
6665
|
|
7
|
|
|
|
|
|
|
|
8
|
169
|
|
|
169
|
|
1004
|
use base 'Test2::Compare::Base'; |
|
169
|
|
|
|
|
364
|
|
|
169
|
|
|
|
|
19184
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.000155'; |
11
|
|
|
|
|
|
|
|
12
|
169
|
|
|
169
|
|
1448
|
use Test2::Util::HashBase qw/input/; |
|
169
|
|
|
|
|
510
|
|
|
169
|
|
|
|
|
1090
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# Overloads '!' for us. |
15
|
169
|
|
|
169
|
|
24980
|
use Test2::Compare::Negatable; |
|
169
|
|
|
|
|
358
|
|
|
169
|
|
|
|
|
1014
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub init { |
18
|
10
|
|
|
10
|
0
|
382
|
my $self = shift; |
19
|
|
|
|
|
|
|
confess "input must be defined for 'Isa' check" |
20
|
10
|
100
|
|
|
|
606
|
unless defined $self->{+INPUT}; |
21
|
|
|
|
|
|
|
|
22
|
9
|
|
|
|
|
56
|
$self->SUPER::init(@_); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub name { |
26
|
7
|
|
|
7
|
1
|
389
|
my $self = shift; |
27
|
7
|
|
|
|
|
22
|
my $in = $self->{+INPUT}; |
28
|
7
|
|
|
|
|
32
|
return "$in"; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub operator { |
32
|
7
|
|
|
7
|
1
|
217
|
my $self = shift; |
33
|
7
|
100
|
|
|
|
31
|
return '!isa' if $self->{+NEGATE}; |
34
|
4
|
|
|
|
|
16
|
return 'isa'; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub verify { |
38
|
33
|
|
|
33
|
1
|
289
|
my $self = shift; |
39
|
33
|
|
|
|
|
103
|
my %params = @_; |
40
|
33
|
|
|
|
|
82
|
my ($got, $exists) = @params{qw/got exists/}; |
41
|
|
|
|
|
|
|
|
42
|
33
|
100
|
|
|
|
97
|
return 0 unless $exists; |
43
|
|
|
|
|
|
|
|
44
|
30
|
|
|
|
|
66
|
my $input = $self->{+INPUT}; |
45
|
30
|
|
|
|
|
295
|
my $negate = $self->{+NEGATE}; |
46
|
30
|
|
100
|
|
|
208
|
my $isa = blessed($got) && $got->isa($input); |
47
|
|
|
|
|
|
|
|
48
|
30
|
100
|
|
|
|
123
|
return !$isa if $negate; |
49
|
21
|
|
|
|
|
248
|
return $isa; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |