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