From: Dave Rolsky Date: Wed, 28 Jan 2009 19:02:07 +0000 (+0000) Subject: Add some tests to ensure that MUC auto-vivifies an unknown name in a X-Git-Tag: 0.66~31 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2b6c2a5c2f6cc6abd7285dd83287e64188f41f6d;p=gitmo%2FMoose.git Add some tests to ensure that MUC auto-vivifies an unknown name in a parameterized type as a class type. --- diff --git a/t/040_type_constraints/011_container_type_constraint.t b/t/040_type_constraints/011_container_type_constraint.t index 9e76ea0..10b8ec9 100644 --- a/t/040_type_constraints/011_container_type_constraint.t +++ b/t/040_type_constraints/011_container_type_constraint.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 22; +use Test::More tests => 24; use Test::Exception; BEGIN { @@ -64,5 +64,10 @@ ok(!$array_of_array_of_ints->check( [[ 1, 2, 3 ], [ qw/foo bar/ ]] ), '... [[ 1, 2, 3 ], [ qw/foo bar/ ]] failed successfully'); +{ + my $anon_type = Moose::Util::TypeConstraints::find_or_parse_type_constraint('ArrayRef[Foo]'); + isa_ok( $anon_type, 'Moose::Meta::TypeConstraint::Parameterized' ); - + my $param_type = $anon_type->type_parameter; + isa_ok( $param_type, 'Moose::Meta::TypeConstraint::Class' ); +}