line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Compare::Negatable; |
2
|
169
|
|
|
169
|
|
1146
|
use strict; |
|
169
|
|
|
|
|
335
|
|
|
169
|
|
|
|
|
5069
|
|
3
|
169
|
|
|
169
|
|
813
|
use warnings; |
|
169
|
|
|
|
|
355
|
|
|
169
|
|
|
|
|
17024
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.000156'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
require overload; |
8
|
|
|
|
|
|
|
require Test2::Util::HashBase; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub import { |
11
|
1173
|
|
|
1173
|
|
5195
|
my ($pkg, $file, $line) = caller; |
12
|
|
|
|
|
|
|
|
13
|
1173
|
50
|
|
|
|
93739
|
my $sub = eval <<" EOT" or die $@; |
14
|
|
|
|
|
|
|
package $pkg; |
15
|
|
|
|
|
|
|
#line $line "$file" |
16
|
|
|
|
|
|
|
sub { overload->import('!' => 'clone_negate', fallback => 1); Test2::Util::HashBase->import('negate')} |
17
|
|
|
|
|
|
|
EOT |
18
|
|
|
|
|
|
|
|
19
|
1173
|
|
|
|
|
4383
|
$sub->(); |
20
|
|
|
|
|
|
|
|
21
|
169
|
|
|
169
|
|
1087
|
no strict 'refs'; |
|
169
|
|
|
|
|
385
|
|
|
169
|
|
|
|
|
30493
|
|
22
|
1173
|
|
|
|
|
103912
|
*{"$pkg\::clone_negate"} = \&clone_negate; |
|
1173
|
|
|
|
|
4790
|
|
23
|
1173
|
|
|
|
|
2380
|
*{"$pkg\::toggle_negate"} = \&toggle_negate; |
|
1173
|
|
|
|
|
415071
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub clone_negate { |
27
|
91
|
|
|
91
|
1
|
632
|
my $self = shift; |
28
|
91
|
|
|
|
|
303
|
my $clone = $self->clone; |
29
|
91
|
|
|
|
|
300
|
$clone->toggle_negate; |
30
|
91
|
|
|
|
|
841
|
return $clone; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub toggle_negate { |
34
|
91
|
|
|
91
|
1
|
161
|
my $self = shift; |
35
|
91
|
100
|
|
|
|
252
|
$self->set_negate($self->negate ? 0 : 1); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |