X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F040_type_constraints%2F015_enum.t;h=162905ee748d0843676bd40740b61568d0d57976;hb=4c015454152fff7c0a2c71665d4dc5e0f39b835b;hp=2aebf75cd7fbddfb846348c40c96f063836b1078;hpb=cbac012a1621da5d2c04ee898cc7f701f17cc045;p=gitmo%2FMoose.git diff --git a/t/040_type_constraints/015_enum.t b/t/040_type_constraints/015_enum.t index 2aebf75..162905e 100644 --- a/t/040_type_constraints/015_enum.t +++ b/t/040_type_constraints/015_enum.t @@ -31,7 +31,7 @@ push @invalid_metacharacters, '^1?$|^(11+?)\1+$'; plan tests => @valid_letters + @invalid_letters + @valid_languages + @invalid_languages + @valid_metacharacters + @invalid_metacharacters - + @valid_languages + 6; + + @valid_languages + 10; Moose::Util::TypeConstraints->export_type_constraints_as_functions(); @@ -59,3 +59,10 @@ ok($anon_enum->check($_), "'$_' is a language") for @valid_languages; ok( !$anon_enum->equals( enum [qw(foo bar)] ), "doesn't equal a diff enum" ); ok( $anon_enum->equals( $anon_enum ), "equals itself" ); ok( $anon_enum->equals( enum \@valid_languages ), "equals duplicate" ); + +ok( !$anon_enum->is_subtype_of('Object'), 'enum not a subtype of Object'); +ok( !$anon_enum->is_a_type_of('Object'), 'enum not type of Object'); + +ok( !$anon_enum->is_subtype_of('ThisTypeDoesNotExist'), 'enum not a subtype of nonexistant type'); +ok( !$anon_enum->is_a_type_of('ThisTypeDoesNotExist'), 'enum not type of nonexistant type'); +