Add a test file for RT #56523
gfx [Sat, 17 Apr 2010 08:09:25 +0000 (17:09 +0900)]
t/900_bug/007_RT56523.t [new file with mode: 0644]

diff --git a/t/900_bug/007_RT56523.t b/t/900_bug/007_RT56523.t
new file mode 100644 (file)
index 0000000..09847c0
--- /dev/null
@@ -0,0 +1,37 @@
+#!/usr/bin/perl
+use strict;
+use Test::More;
+warn $Mouse::VERSION;
+{
+    package Foo;
+
+    use Mouse;
+
+    has thing => (
+        reader        => 'thing',
+        writer        => 'set_thing',
+        builder       => '_build_thing',
+        lazy          => 1,
+    );
+
+    sub _build_thing {
+        42;
+    }
+}
+
+# Get them set
+{
+    my $obj = Foo->new;
+    is $obj->thing, 42;
+    $obj->set_thing( 23 );
+    is $obj->thing, 23;
+}
+
+# Set then get
+{
+    my $obj = Foo->new;
+    $obj->set_thing(23);
+    is $obj->thing, 23;
+}
+
+done_testing();