projects
/
p5sagit/Mutually-Assured-Destruction.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
working flip-flop via DESTROY approach
[p5sagit/Mutually-Assured-Destruction.git]
/
t
/
01simple.t
1
use strict;
2
use warnings;
3
use Test::More;
4
use Scalar::Util qw(weaken);
5
6
my %real;
7
my %weak;
8
9
@weak{qw(one two)} = @real{qw(one two)} = ({}, {});
10
11
weaken($_) for values %weak;
12
13
delete @real{keys %real};
14
15
cmp_ok(
16
(scalar grep defined, values %weak), '==', 0,
17
'All objects destroyed now'
18
);
19
20
done_testing;