line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Compare::Negatable; |
2
|
168
|
|
|
168
|
|
1070
|
use strict; |
|
168
|
|
|
|
|
336
|
|
|
168
|
|
|
|
|
4501
|
|
3
|
168
|
|
|
168
|
|
849
|
use warnings; |
|
168
|
|
|
|
|
313
|
|
|
168
|
|
|
|
|
16264
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.000153'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
require overload; |
8
|
|
|
|
|
|
|
require Test2::Util::HashBase; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub import { |
11
|
1166
|
|
|
1166
|
|
5139
|
my ($pkg, $file, $line) = caller; |
12
|
|
|
|
|
|
|
|
13
|
1166
|
50
|
|
|
|
85217
|
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
|
1166
|
|
|
|
|
4187
|
$sub->(); |
20
|
|
|
|
|
|
|
|
21
|
168
|
|
|
168
|
|
994
|
no strict 'refs'; |
|
168
|
|
|
|
|
327
|
|
|
168
|
|
|
|
|
27306
|
|
22
|
1166
|
|
|
|
|
101489
|
*{"$pkg\::clone_negate"} = \&clone_negate; |
|
1166
|
|
|
|
|
4588
|
|
23
|
1166
|
|
|
|
|
2096
|
*{"$pkg\::toggle_negate"} = \&toggle_negate; |
|
1166
|
|
|
|
|
357145
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub clone_negate { |
27
|
87
|
|
|
87
|
1
|
551
|
my $self = shift; |
28
|
87
|
|
|
|
|
281
|
my $clone = $self->clone; |
29
|
87
|
|
|
|
|
322
|
$clone->toggle_negate; |
30
|
87
|
|
|
|
|
655
|
return $clone; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub toggle_negate { |
34
|
87
|
|
|
87
|
1
|
128
|
my $self = shift; |
35
|
87
|
100
|
|
|
|
238
|
$self->set_negate($self->negate ? 0 : 1); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |