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