6 use Test::More tests => 7;
9 use_ok('Moose::Util::TypeConstraints');
22 extends qw(Bar Gorch);
25 my $type = find_type_constraint("Foo");
27 ok( $type->is_subtype_of("Gorch"), "subtype of gorch" );
29 ok( $type->is_subtype_of("Bar"), "subtype of bar" );
31 ok( $type->is_subtype_of("Object"), "subtype of Object" );
33 ok( find_type_constraint("Bar")->check(Foo->new), "Foo passes Bar" );
34 ok( find_type_constraint("Bar")->check(Bar->new), "Bar passes Bar" );
35 ok( !find_type_constraint("Gorch")->check(Bar->new), "but Bar doesn't pass Gorch");