From: Dave Rolsky Date: Fri, 16 Sep 2011 14:09:43 +0000 (-0500) Subject: Union types are not types of their component types X-Git-Tag: 2.0300~51 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4afd861de36529c371f794724b394f6df5cc89df;p=gitmo%2FMoose.git Union types are not types of their component types --- diff --git a/t/type_constraints/union_types.t b/t/type_constraints/union_types.t index 4b46e8c..cc539c7 100644 --- a/t/type_constraints/union_types.t +++ b/t/type_constraints/union_types.t @@ -24,8 +24,8 @@ isa_ok($Str_or_Undef, 'Moose::Meta::TypeConstraint::Union'); ok($Str_or_Undef->check(undef), '... (Str | Undef) can accept an Undef value'); ok($Str_or_Undef->check('String'), '... (Str | Undef) can accept a String value'); -ok($Str_or_Undef->is_a_type_of($Str), "subtype of Str"); -ok($Str_or_Undef->is_a_type_of($Undef), "subtype of Undef"); +ok(!$Str_or_Undef->is_a_type_of($Str), "subtype of Str"); +ok(!$Str_or_Undef->is_a_type_of($Undef), "subtype of Undef"); cmp_ok($Str_or_Undef->find_type_for('String'), 'eq', 'Str', 'find_type_for Str'); cmp_ok($Str_or_Undef->find_type_for(undef), 'eq', 'Undef', 'find_type_for Undef');