Commit | Line | Data |
46f2b34a |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
6 | use Test::Fatal qw(lives_ok); |
7 | use Test::More; |
8 | |
9 | use Moose::Util::TypeConstraints (); |
10 | |
11 | lives_ok { |
12 | ok !Moose::Util::TypeConstraints::find_or_create_type_constraint('Int')->equals('Str'); |
13 | }; |
14 | |
15 | lives_ok { |
16 | ok !Moose::Util::TypeConstraints::find_or_create_type_constraint('Int')->equals('NoSuchType'); |
17 | }; |
18 | |
19 | lives_ok { |
20 | ok !Moose::Util::TypeConstraints::find_or_create_type_constraint('ArrayRef[Int]')->equals('ArrayRef[Str]'); |
21 | }; |
22 | |
23 | lives_ok { |
24 | ok !Moose::Util::TypeConstraints::find_or_create_type_constraint('ArrayRef[Int]')->equals('SomeNonType'); |
25 | }; |
26 | |
27 | my $tc = Moose::Util::TypeConstraints::find_type_constraint('HashRef')->parameterize('Int'); |
28 | lives_ok { |
29 | ok $tc->equals('HashRef[Int]'); |
30 | }; |
31 | |
32 | done_testing; |