handle non-lazy default and builder when init_arg is undef
[gitmo/Moo.git] / t / accessor-default.t
index 2cec9c0..1f3fbac 100644 (file)
@@ -13,6 +13,7 @@ use Test::More;
   has three => (is => 'ro', default => quote_sub q{ {} });
   has four => (is => 'ro', builder => '_build_four');
   sub _build_four { {} }
+  has five => (is => 'ro', init_arg => undef, default => sub { {} });
 }
 
 sub check {
@@ -31,4 +32,6 @@ check three => map Foo->new->{three}, 1..2;
 
 check four => map Foo->new->{four}, 1..2;
 
+check five => map Foo->new->{five}, 1..2;
+
 done_testing;