X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F040_type_constraints%2F017_subtyping_union_types.t;h=626a4bb2fff57439015f8378dae87c99612be154;hb=d03bd989b97597428b460d7f9a021e2931893fa0;hp=44ffd95b1093a981e2306b5a05872602f7e87db7;hpb=f6bee6fe1d579dc3d2ed2952cce9a1556040c8e5;p=gitmo%2FMoose.git diff --git a/t/040_type_constraints/017_subtyping_union_types.t b/t/040_type_constraints/017_subtyping_union_types.t index 44ffd95..626a4bb 100644 --- a/t/040_type_constraints/017_subtyping_union_types.t +++ b/t/040_type_constraints/017_subtyping_union_types.t @@ -27,19 +27,19 @@ lives_ok { is($p->name, 'ArrayRef|HashRef', '... parent name is correct'); ok($t->check([]), '... validated it correctly'); - ok($t->check({}), '... validated it correctly'); + ok($t->check({}), '... validated it correctly'); ok(!$t->check(1), '... validated it correctly'); } lives_ok { - subtype 'MyCollectionsExtended' + subtype 'MyCollectionsExtended' => as 'ArrayRef|HashRef' => where { if (ref($_) eq 'ARRAY') { return if scalar(@$_) < 2; } elsif (ref($_) eq 'HASH') { - return if scalar(keys(%$_)) < 2; + return if scalar(keys(%$_)) < 2; } 1; }; @@ -58,11 +58,11 @@ lives_ok { is($p->name, 'ArrayRef|HashRef', '... parent name is correct'); ok(!$t->check([]), '... validated it correctly'); - ok($t->check([1, 2]), '... validated it correctly'); - - ok(!$t->check({}), '... validated it correctly'); - ok($t->check({ one => 1, two => 2 }), '... validated it correctly'); - + ok($t->check([1, 2]), '... validated it correctly'); + + ok(!$t->check({}), '... validated it correctly'); + ok($t->check({ one => 1, two => 2 }), '... validated it correctly'); + ok(!$t->check(1), '... validated it correctly'); }