Fix missing escape on < 5.8.3 codepath
[gitmo/Role-Tiny.git] / t / accessor-default.t
index af6e448..1f3fbac 100644 (file)
@@ -5,14 +5,15 @@ use Test::More;
   package Foo;
 
   use Sub::Quote;
-  use Class::Tiny;
+  use Moo;
 
   has one => (is => 'ro', lazy => 1, default => quote_sub q{ {} });
   has two => (is => 'ro', lazy => 1, builder => '_build_two');
   sub _build_two { {} }
   has three => (is => 'ro', default => quote_sub q{ {} });
-  has four => (is => 'ro', default => '_build_four');
+  has four => (is => 'ro', builder => '_build_four');
   sub _build_four { {} }
+  has five => (is => 'ro', init_arg => undef, default => sub { {} });
 }
 
 sub check {
@@ -27,4 +28,10 @@ check one => map Foo->new->one, 1..2;
 
 check two => map Foo->new->two, 1..2;
 
+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;