From: Matt S Trout Date: Tue, 3 Jul 2007 01:10:23 +0000 (+0000) Subject: fixes for CDI/CDA compat X-Git-Tag: v0.07000~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9c3d517999ac5ebe07b701bfa96a7d42f40e9201;p=p5sagit%2FClass-Accessor-Grouped.git fixes for CDI/CDA compat --- diff --git a/Changes b/Changes index 5d2eda7..ce5af25 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for Class::Accessor::Grouped. + - Altered get_inherited to return undef rather than () when no value + set for Class::Data::(Inheritable|Accessor) compatiblity + 0.06001 - Fixed spelling test error - Added WriteAll/DIST/PREOP for README diff --git a/lib/Class/Accessor/Grouped.pm b/lib/Class/Accessor/Grouped.pm index 051b70c..8c8e5cb 100644 --- a/lib/Class/Accessor/Grouped.pm +++ b/lib/Class/Accessor/Grouped.pm @@ -318,7 +318,7 @@ sub get_inherited { return ${$_.'::__cag_'.$get} if defined(${$_.'::__cag_'.$get}); }; - return; + return undef; } =head2 set_inherited diff --git a/t/inherited.t b/t/inherited.t index 43f5b6e..80ef240 100644 --- a/t/inherited.t +++ b/t/inherited.t @@ -1,4 +1,4 @@ -use Test::More tests => 33; +use Test::More tests => 35; use strict; use warnings; use lib 't/lib'; @@ -8,6 +8,11 @@ use NotHashBased; my $super = SuperInheritedGroups->new; my $base = BaseInheritedGroups->new; +my @ret = SuperInheritedGroups->basefield; + +ok(@ret == 1, 'Return value before set'); +ok(!defined(SuperInheritedGroups->basefield), 'Undef return before set'); + # set base. base, super, object = base is(BaseInheritedGroups->basefield('All Your Base'), 'All Your Base'); is(SuperInheritedGroups->basefield, 'All Your Base');