From: Christopher H. Laco Date: Thu, 25 May 2006 02:17:25 +0000 (+0000) Subject: Added get_inherited tests verify we get defined things like 0, '' instead of proceedi... X-Git-Tag: v0.04000~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2d6912a00d1c8dacdb0e3cfcec1877ca60172041;p=p5sagit%2FClass-Accessor-Grouped.git Added get_inherited tests verify we get defined things like 0, '' instead of proceeding to super class --- diff --git a/t/inherited.t b/t/inherited.t index 46a545a..dedcc15 100644 --- a/t/inherited.t +++ b/t/inherited.t @@ -1,4 +1,4 @@ -use Test::More tests => 29; +use Test::More tests => 32; use strict; use warnings; use lib 't/lib'; @@ -61,3 +61,17 @@ eval { $dying->killme('foo'); }; ok($@ =~ /Cannot set.*is not hash-based/); + +# make sure we're get defined items, even 0, '' +BaseInheritedGroups->basefield('base'); +SuperInheritedGroups->basefield(0); +is(SuperInheritedGroups->basefield, 0); + +BaseInheritedGroups->basefield('base'); +SuperInheritedGroups->basefield(''); +is(SuperInheritedGroups->basefield, ''); + +BaseInheritedGroups->basefield('base'); +SuperInheritedGroups->basefield(undef); +is(SuperInheritedGroups->basefield, 'base'); +