Move is_valid_class_name into XS
[gitmo/Mouse.git] / t / 001_mouse / 059-weak-with-default.t
CommitLineData
434bcb42 1#!perl
2use strict;
3use warnings;
8aba926d 4use Test::More tests => 6;
434bcb42 5
6{
7 package MyClass;
8 use Mouse;
9
10 has lazy_weak_with_default => (
11 is => 'rw',
12 isa => 'Ref',
13 weak_ref => 1,
14 lazy => 1,
15 default => sub{ [] },
16 );
17
18 has weak_with_default => (
19 is => 'rw',
20 isa => 'Ref',
21 weak_ref => 1,
22 default => sub{ [] },
23 );
24
25}
26
27my $o = MyClass->new();
28is($o->weak_with_default, undef);
29is($o->lazy_weak_with_default, undef);
8aba926d 30is($o->lazy_weak_with_default, undef);
434bcb42 31
32MyClass->meta->make_immutable();
33
34$o = MyClass->new();
35is($o->weak_with_default, undef);
36is($o->lazy_weak_with_default, undef);
8aba926d 37is($o->lazy_weak_with_default, undef);