[Moose-commits] r7405 - Moose/trunk/t/040_type_constraints

autarch at code2.0beta.co.uk autarch at code2.0beta.co.uk
Wed Jan 28 19:02:07 GMT 2009


Author: autarch
Date: 2009-01-28 11:02:07 -0800 (Wed, 28 Jan 2009)
New Revision: 7405

Modified:
   Moose/trunk/t/040_type_constraints/011_container_type_constraint.t
Log:
Add some tests to ensure that MUC auto-vivifies an unknown name in a
parameterized type as a class type.


Modified: Moose/trunk/t/040_type_constraints/011_container_type_constraint.t
===================================================================
--- Moose/trunk/t/040_type_constraints/011_container_type_constraint.t	2009-01-28 18:47:23 UTC (rev 7404)
+++ Moose/trunk/t/040_type_constraints/011_container_type_constraint.t	2009-01-28 19:02:07 UTC (rev 7405)
@@ -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 @@
     [[ 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' );
+}




More information about the Moose-commits mailing list