2 # This is automatically generated by author/import-moose-test.pl.
3 # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4 use t::lib::MooseCompat;
6 # In the case where a child type constraint's parent constraint fails,
7 # the exception should reference the parent type constraint that actually
8 # failed instead of always referencing the child'd type constraint
17 use_ok('Mouse::Util::TypeConstraints');
21 subtype 'ParentConstraint' => as 'Str' => where {0};
22 } 'specified parent type constraint';
26 $tc = subtype 'ChildConstraint' => as 'ParentConstraint' => where {1};
27 } 'specified child type constraint';
30 my $errmsg = $tc->validate();
33 local $TODO = 'Not yet supported';
34 ok($errmsg !~ /Validation failed for 'ChildConstraint'/, 'exception references failing parent constraint');