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