Convert all tests to done_testing.
[gitmo/Moose.git] / t / 040_type_constraints / 002_util_type_constraints_export.t
CommitLineData
a15dff8d 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
a28e50e4 6use Test::More;
a15dff8d 7use Test::Exception;
8
a15dff8d 9{
10 package Foo;
11
3860f446 12 use Moose::Util::TypeConstraints;
13
1a2cafee 14 eval {
15 type MyRef => where { ref($_) };
16 };
17 ::ok( !$@, '... successfully exported &type to Foo package' );
18
19 eval {
20 subtype MyArrayRef => as MyRef => where { ref($_) eq 'ARRAY' };
21 };
22 ::ok( !$@, '... successfully exported &subtype to Foo package' );
23
24 Moose::Util::TypeConstraints->export_type_constraints_as_functions();
25
26 ::ok( MyRef( {} ), '... Ref worked correctly' );
27 ::ok( MyArrayRef( [] ), '... ArrayRef worked correctly' );
28}
a28e50e4 29
30done_testing;