From: gfx Date: Sat, 17 Apr 2010 08:09:25 +0000 (+0900) Subject: Add a test file for RT #56523 X-Git-Tag: 0.54~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6cff6b7a918f138071c6475a0549f2317a40db8f;p=gitmo%2FMouse.git Add a test file for RT #56523 --- diff --git a/t/900_bug/007_RT56523.t b/t/900_bug/007_RT56523.t new file mode 100644 index 0000000..09847c0 --- /dev/null +++ b/t/900_bug/007_RT56523.t @@ -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();