X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F040_type_constraints%2F013_advanced_type_creation.t;h=1350fdcedb5d3b7cf2ac9f942029020dcab7a9c0;hb=f0b2e5673e864903e74a429565d0c57b69a60b95;hp=9d15c7abf17cfc4d2d576d26f58f7b9c2c275dd9;hpb=0fbd4b0a825a44f70a4e8537f50712dafac3c938;p=gitmo%2FMoose.git diff --git a/t/040_type_constraints/013_advanced_type_creation.t b/t/040_type_constraints/013_advanced_type_creation.t index 9d15c7a..1350fdc 100644 --- a/t/040_type_constraints/013_advanced_type_creation.t +++ b/t/040_type_constraints/013_advanced_type_creation.t @@ -3,12 +3,11 @@ use strict; use warnings; -use Test::More tests => 33; -use Test::Exception; +use Test::More; -BEGIN { - use_ok('Moose::Util::TypeConstraints'); - use_ok('Moose::Meta::TypeConstraint::Parameterized'); +BEGIN { + use_ok('Moose::Util::TypeConstraints'); + use_ok('Moose::Meta::TypeConstraint::Parameterized'); } my $r = Moose::Util::TypeConstraints->get_type_constraint_registry; @@ -17,7 +16,7 @@ my $r = Moose::Util::TypeConstraints->get_type_constraint_registry; # Array of Ints or Strings -my $array_of_ints_or_strings = Moose::Util::TypeConstraints::create_parameterized_type_constraint('ArrayRef[Int | Str]'); +my $array_of_ints_or_strings = Moose::Util::TypeConstraints::create_parameterized_type_constraint('ArrayRef[Int|Str]'); isa_ok($array_of_ints_or_strings, 'Moose::Meta::TypeConstraint::Parameterized'); ok($array_of_ints_or_strings->check([ 1, 'two', 3 ]), '... this passed the type check'); @@ -43,10 +42,10 @@ $r->add_type_constraint($array_of_ints_or_hash_ref); # union of Arrays of Str | Int or Arrays of Int | Hash -# we can't build this using the simplistic parser +# we can't build this using the simplistic parser # we have, so we have to do it by hand - SL -my $pure_insanity = Moose::Util::TypeConstraints::create_type_constraint_union('ArrayRef[Int | Str] | ArrayRef[Int | HashRef]'); +my $pure_insanity = Moose::Util::TypeConstraints::create_type_constraint_union('ArrayRef[Int|Str] | ArrayRef[Int | HashRef]'); isa_ok($pure_insanity, 'Moose::Meta::TypeConstraint::Union'); ok($pure_insanity->check([ 1, {}, 3 ]), '... this passed the type check'); @@ -97,5 +96,4 @@ ok(!$array_of_array_of_array_of_ints->check( [[[ 1, 2, 3 ]], [[ qw/foo bar/ ]]] ), '... [[[ 1, 2, 3 ]], [[ qw/foo bar/ ]]] failed successfully'); - - +done_testing;