Remove numbers from our tests
[gitmo/Moose.git] / t / type_constraints / util_type_constraints_export.t
diff --git a/t/type_constraints/util_type_constraints_export.t b/t/type_constraints/util_type_constraints_export.t
new file mode 100644 (file)
index 0000000..0ecd3fb
--- /dev/null
@@ -0,0 +1,29 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+{
+    package Foo;
+
+    use Moose::Util::TypeConstraints;
+
+    eval {
+        type MyRef => where { ref($_) };
+    };
+    ::ok( !$@, '... successfully exported &type to Foo package' );
+
+    eval {
+        subtype MyArrayRef => as MyRef => where { ref($_) eq 'ARRAY' };
+    };
+    ::ok( !$@, '... successfully exported &subtype to Foo package' );
+
+    Moose::Util::TypeConstraints->export_type_constraints_as_functions();
+
+    ::ok( MyRef( {} ), '... Ref worked correctly' );
+    ::ok( MyArrayRef( [] ), '... ArrayRef worked correctly' );
+}
+
+done_testing;