type constraints now stringify to their name (phaylon)
[gitmo/Moose.git] / t / 053_util_find_type_constraint.t
index 242abf9..5756cb8 100644 (file)
@@ -3,10 +3,36 @@
 use strict;
 use warnings;
 
-use Test::More tests => 1;
+use Test::More tests => 18;
 use Test::Exception;
 
 BEGIN {
-       use_ok('Moose::Util::TypeConstraints', (':no_export'));
+       use_ok('Moose::Util::TypeConstraints');
 }
 
+foreach my $type_name (qw(
+    Any
+    Item 
+        Bool
+        Undef
+        Defined
+            Value
+                Num
+                  Int
+                Str
+            Ref
+                ScalarRef
+                ArrayRef
+                HashRef
+                CodeRef
+                RegexpRef
+                Object 
+                    Role
+    )) {
+    is(find_type_constraint($type_name)->name, 
+       $type_name, 
+       '... got the right name for ' . $type_name);
+}
+
+# TODO:
+# add tests for is_subtype_of which confirm the hierarchy
\ No newline at end of file