More type constraint fixes for edge cases in is_a_type_of and is_a_subtype_of when...
[gitmo/Moose.git] / t / 040_type_constraints / 008_union_types.t
index 16227bc..5c84661 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 33;
+use Test::More tests => 35;
 use Test::Exception;
 
 BEGIN {
@@ -35,6 +35,9 @@ ok( $Str_or_Undef->equals($Str_or_Undef), "equal to self" );
 ok( $Str_or_Undef->equals(Moose::Meta::TypeConstraint::Union->new(type_constraints => [ $Str, $Undef ])), "equal to clone" );
 ok( $Str_or_Undef->equals(Moose::Meta::TypeConstraint::Union->new(type_constraints => [ $Undef, $Str ])), "equal to reversed clone" );
 
+ok( !$Str_or_Undef->is_a_type_of("ThisTypeDoesNotExist"), "not type of non existant type" );
+ok( !$Str_or_Undef->is_subtype_of("ThisTypeDoesNotExist"), "not subtype of non existant type" );
+
 # another ....
 
 my $ArrayRef = find_type_constraint('ArrayRef');