line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Compare::Negatable; |
2
|
169
|
|
|
169
|
|
1278
|
use strict; |
|
169
|
|
|
|
|
316
|
|
|
169
|
|
|
|
|
4821
|
|
3
|
169
|
|
|
169
|
|
866
|
use warnings; |
|
169
|
|
|
|
|
359
|
|
|
169
|
|
|
|
|
17167
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.000155'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
require overload; |
8
|
|
|
|
|
|
|
require Test2::Util::HashBase; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub import { |
11
|
1173
|
|
|
1173
|
|
5083
|
my ($pkg, $file, $line) = caller; |
12
|
|
|
|
|
|
|
|
13
|
1173
|
50
|
|
|
|
90692
|
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
|
|
|
|
|
4504
|
$sub->(); |
20
|
|
|
|
|
|
|
|
21
|
169
|
|
|
169
|
|
1583
|
no strict 'refs'; |
|
169
|
|
|
|
|
394
|
|
|
169
|
|
|
|
|
29594
|
|
22
|
1173
|
|
|
|
|
106567
|
*{"$pkg\::clone_negate"} = \&clone_negate; |
|
1173
|
|
|
|
|
4748
|
|
23
|
1173
|
|
|
|
|
2260
|
*{"$pkg\::toggle_negate"} = \&toggle_negate; |
|
1173
|
|
|
|
|
383927
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub clone_negate { |
27
|
87
|
|
|
87
|
1
|
535
|
my $self = shift; |
28
|
87
|
|
|
|
|
244
|
my $clone = $self->clone; |
29
|
87
|
|
|
|
|
262
|
$clone->toggle_negate; |
30
|
87
|
|
|
|
|
799
|
return $clone; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub toggle_negate { |
34
|
87
|
|
|
87
|
1
|
174
|
my $self = shift; |
35
|
87
|
100
|
|
|
|
230
|
$self->set_negate($self->negate ? 0 : 1); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |