Switch package name for class+role composed class to be valid
[gitmo/Role-Tiny.git] / t / accessor-weaken.t
CommitLineData
32381de9 1use strictures 1;
2use Test::More;
3
4{
5 package Foo;
6
7 use Moo;
8
9 has one => (is => 'ro', weak_ref => 1);
10}
11
12my $ref = \'yay';
13
14my $foo = Foo->new(one => $ref);
15
16is(${$foo->one},'yay', 'value present');
17ok(Scalar::Util::isweak($foo->{one}), 'value weakened');
18
19done_testing;