Created
June 30, 2010 20:44
-
-
Save jjn1056/459194 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $deep_tuple = subtype 'deep_tuple', | |
as Tuple[ | |
Int, | |
HashRef, | |
Dict[ | |
name=>Str, | |
age=>Int, | |
], | |
]; | |
warn $deep_tuple->validate([1,{a=>2},{name=>'Vincent1',age=>'Hello1'}]); | |
## Error message is now: | |
Validation failed for 'deep_tuple' with value [ 1, { a: 2 }, { age: "Hello1", name: "Vincent1" } ], Internal Validation Error is: Validation failed for 'MooseX::Types::Structured::Dict[name,Str,age,Int]' with value { age: "Hello1", name: "Vincent1" }, Internal Validation Error is: Validation failed for 'Int' with value Hello1 at t/12-error.t line 130. | |
ok |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment