4 use Test::More tests => 8;
14 default => sub { [1] },
21 default => sub { sub { 1 } },
30 } qr/References are not allowed as default values/;
37 } qr/References are not allowed as default values/;
44 } qr/References are not allowed as default values/;
47 is(ref(Class->new->code), 'CODE', "default => sub { sub { 1 } } stuffs a coderef");
48 is(Class->new->code->(), 1, "default => sub sub strips off the first coderef");
49 is_deeply(Class->new->a, [1], "default of sub { reference } works");