stubb for deep validation
[gitmo/MooseX-Types-Structured.git] / t / 13-deeper_error.t
CommitLineData
14375407 1use strict;
2use warnings;
3use Test::More;
4
5use Moose::Util::TypeConstraints;
6use MooseX::Types::Structured qw(Dict Tuple);
7use MooseX::Types::Moose qw(Int);
8
9my $deeper_tc = subtype
10 as Dict[
11 a => Tuple[
12 Dict[
13 a1a => Tuple[Int],
14 a1b => Tuple[Int],
15 ],
16 Dict[
17 a2a => Tuple[Int],
18 a2b => Tuple[Int],
19 ],
20 ],
21 b => Tuple[
22 Dict[
23 b1a => Tuple[Int],
24 b1b => Tuple[Int],
25 ],
26 Dict[
27 b2a => Tuple[Int],
28 b2b => Tuple[Int],
29 ],
30 ],
31 ];
32
33my $struc_to_validate = {
34 a=>[
35 {
36 a1a=>[1],
37 a1b=>[2]
38 },
39 {
0027a103 40 a2a=>['AA'],
14375407 41 a2b=>[4]
42 }
43 ],
44 b=>[
45 {
46 b1a=>[5],
0027a103 47 b1b=>['BB']
14375407 48 },
49 {
50 b2a=>[7],
51 b2b=>[8]
52 }
53 ]
54};
55
56ok my $message = $deeper_tc->validate($struc_to_validate),
57'got error message of some sort';
58
59done_testing();
60
61warn $message;