Add type_parameter() and __is_parameterized() to Meta::TypeConstraint
[gitmo/Mouse.git] / t / 001_mouse / 043-parameterized-type.t
index 74b3ea9..3e223e2 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env perl
 use strict;
 use warnings;
-use Test::More tests => 51;
+use Test::More tests => 54;
 use Test::Exception;
 
 use Tie::Hash;
@@ -210,4 +210,15 @@ while(my($k, $v) = each %th){
     $th_clone{$k} = $v;
 }
 
+is( $hash_of_int->type_parameter, 'Int' );
+
+if('Mouse' eq ('Mo' . 'use')){ # under Mouse
+    ok $hash_of_int->__is_parameterized();
+    ok!$hash_of_int->type_parameter->__is_parameterized();
+}
+else{ # under Moose
+    ok $hash_of_int->can('type_parameter');
+    ok!$hash_of_int->type_parameter->can('type_parameter');
+}
+
 is_deeply \%th_clone, \%th, 'the hash iterator is initialized';