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