From: Dave Rolsky Date: Sat, 17 Sep 2011 14:37:10 +0000 (-0500) Subject: Add tests for ->parent & ->parents on union type X-Git-Tag: 2.0300~46 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c4663f6f2424bc54f1a9c1b650bbf3661b7fc0e4;p=gitmo%2FMoose.git Add tests for ->parent & ->parents on union type --- diff --git a/t/type_constraints/union_types.t b/t/type_constraints/union_types.t index ac4ad08..cd26f57 100644 --- a/t/type_constraints/union_types.t +++ b/t/type_constraints/union_types.t @@ -75,6 +75,18 @@ ok( "not subtype of non existent type" ); +is( + $Str_or_Undef->parent, + find_type_constraint('Item'), + 'parent of Str|Undef is Item' +); + +is( + $Str_or_Undef->parents, + find_type_constraint('Item'), + 'parents of Str|Undef is Item' +); + # another .... my $ArrayRef = find_type_constraint('ArrayRef'); @@ -137,4 +149,7 @@ is( '... (ArrayRef | HashRef) cannot accept Numbers' ); +is( + $HasOr + done_testing;