6 use Test::More tests => 10;
15 package Test::TheDefaultFor::ArrayRef::and::HashRef;
18 has 'array_ref' => (is => 'rw', isa => 'ArrayRef');
19 has 'hash_ref' => (is => 'rw', isa => 'HashRef');
23 my $test = Test::TheDefaultFor::ArrayRef::and::HashRef->new;
24 isa_ok($test, 'Test::TheDefaultFor::ArrayRef::and::HashRef');
26 is_deeply($test->array_ref, [], '.... got the right default value');
27 is_deeply($test->hash_ref, {}, '.... got the right default value');
29 my $test2 = Test::TheDefaultFor::ArrayRef::and::HashRef->new(
30 array_ref => [ 1, 2, [] ],
31 hash_ref => { one => 1, two => 2, three => {} },
33 isa_ok($test2, 'Test::TheDefaultFor::ArrayRef::and::HashRef');
35 is_deeply($test2->array_ref, [ 1, 2, [] ], '.... got the right default value');
36 is_deeply($test2->hash_ref, { one => 1, two => 2, three => {} }, '.... got the right default value');
41 package Test::For::Lazy::TypeConstraint;
43 use Moose::Util::TypeConstraints;
45 has 'bad_lazy_attr' => (
49 default => sub { "test" },
52 has 'good_lazy_attr' => (
56 default => sub { [] },
61 my $test = Test::For::Lazy::TypeConstraint->new;
62 isa_ok($test, 'Test::For::Lazy::TypeConstraint');
66 } '... this does not work';
69 $test->good_lazy_attr;
70 } '... this does not work';