Added get_inherited tests verify we get defined things like 0, '' instead of proceedi...
Christopher H. Laco [Thu, 25 May 2006 02:17:25 +0000 (02:17 +0000)]
t/inherited.t

index 46a545a..dedcc15 100644 (file)
@@ -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');
+