3 # In the case where a child type constraint's parent constraint fails,
4 # the exception should reference the parent type constraint that actually
5 # failed instead of always referencing the child'd type constraint
14 use_ok('Moose::Util::TypeConstraints');
18 subtype 'ParentConstraint' => as 'Str' => where {0};
19 } 'specified parent type constraint';
23 $tc = subtype 'ChildConstraint' => as 'ParentConstraint' => where {1};
24 } 'specified child type constraint';
27 my $errmsg = $tc->validate();
30 local $TODO = 'Not yet supported';
31 ok($errmsg !~ /Validation failed for 'ChildConstraint'/, 'exception references failing parent constraint');