X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F040_type_constraints%2F011_container_type_constraint.t;h=9e76ea08f59ab6ac137b41281cb76c66fa7cf5c2;hb=e94a703f591f40cd63157848698fccb0554b4f99;hp=eb54e3bd3942f8aa3a25f832b6bd5a7cdc026e05;hpb=b17a3035c66fc43b00413edf83882b2ceebfcff1;p=gitmo%2FMoose.git diff --git a/t/040_type_constraints/011_container_type_constraint.t b/t/040_type_constraints/011_container_type_constraint.t index eb54e3b..9e76ea0 100644 --- a/t/040_type_constraints/011_container_type_constraint.t +++ b/t/040_type_constraints/011_container_type_constraint.t @@ -8,17 +8,17 @@ use Test::Exception; BEGIN { use_ok('Moose::Util::TypeConstraints'); - use_ok('Moose::Meta::TypeConstraint::Container'); + use_ok('Moose::Meta::TypeConstraint::Parameterized'); } # Array of Ints -my $array_of_ints = Moose::Meta::TypeConstraint::Container->new( +my $array_of_ints = Moose::Meta::TypeConstraint::Parameterized->new( name => 'ArrayRef[Int]', parent => find_type_constraint('ArrayRef'), - container_type => find_type_constraint('Int'), + type_parameter => find_type_constraint('Int'), ); -isa_ok($array_of_ints, 'Moose::Meta::TypeConstraint::Container'); +isa_ok($array_of_ints, 'Moose::Meta::TypeConstraint::Parameterized'); isa_ok($array_of_ints, 'Moose::Meta::TypeConstraint'); ok($array_of_ints->check([ 1, 2, 3, 4 ]), '... [ 1, 2, 3, 4 ] passed successfully'); @@ -31,12 +31,12 @@ ok(!$array_of_ints->check(sub { () }), '... sub { () } failed successfully'); # Hash of Ints -my $hash_of_ints = Moose::Meta::TypeConstraint::Container->new( +my $hash_of_ints = Moose::Meta::TypeConstraint::Parameterized->new( name => 'HashRef[Int]', parent => find_type_constraint('HashRef'), - container_type => find_type_constraint('Int'), + type_parameter => find_type_constraint('Int'), ); -isa_ok($hash_of_ints, 'Moose::Meta::TypeConstraint::Container'); +isa_ok($hash_of_ints, 'Moose::Meta::TypeConstraint::Parameterized'); isa_ok($hash_of_ints, 'Moose::Meta::TypeConstraint'); ok($hash_of_ints->check({ one => 1, two => 2, three => 3 }), '... { one => 1, two => 2, three => 3 } passed successfully'); @@ -49,12 +49,12 @@ ok(!$hash_of_ints->check(sub { () }), '... sub { () } failed successfully'); # Array of Array of Ints -my $array_of_array_of_ints = Moose::Meta::TypeConstraint::Container->new( +my $array_of_array_of_ints = Moose::Meta::TypeConstraint::Parameterized->new( name => 'ArrayRef[ArrayRef[Int]]', parent => find_type_constraint('ArrayRef'), - container_type => $array_of_ints, + type_parameter => $array_of_ints, ); -isa_ok($array_of_array_of_ints, 'Moose::Meta::TypeConstraint::Container'); +isa_ok($array_of_array_of_ints, 'Moose::Meta::TypeConstraint::Parameterized'); isa_ok($array_of_array_of_ints, 'Moose::Meta::TypeConstraint'); ok($array_of_array_of_ints->check( @@ -64,3 +64,5 @@ ok(!$array_of_array_of_ints->check( [[ 1, 2, 3 ], [ qw/foo bar/ ]] ), '... [[ 1, 2, 3 ], [ qw/foo bar/ ]] failed successfully'); + +