Commit | Line | Data |
b2b106d7 |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
66509156 |
6 | use Test::More tests => 17; |
b2b106d7 |
7 | use Test::Exception; |
8 | |
9 | BEGIN { |
10 | use_ok('Mouse::Util::TypeConstraints'); |
11 | } |
12 | |
13 | foreach my $type_name (qw( |
14 | Any |
15 | Item |
16 | Bool |
17 | Undef |
18 | Defined |
19 | Value |
20 | Num |
21 | Int |
22 | Str |
23 | Ref |
24 | ScalarRef |
25 | ArrayRef |
26 | HashRef |
27 | CodeRef |
28 | RegexpRef |
29 | Object |
b2b106d7 |
30 | )) { |
31 | is(find_type_constraint($type_name)->name, |
32 | $type_name, |
33 | '... got the right name for ' . $type_name); |
34 | } |
35 | |
36 | # TODO: |
37 | # add tests for is_subtype_of which confirm the hierarchy |