6 use Test::More tests => 2;
10 use MooseX::Types -declare => [qw/
11 MyChar MyDigit ArrayRefOfMyCharOrDigit
13 use MooseX::Types::Moose qw/ArrayRef Str Int/;
15 subtype MyChar, as Str, where {
19 subtype MyDigit, as Int, where {
23 coerce ArrayRef[MyChar|MyDigit], from Str, via {
27 # same thing with an explicit subtype
28 subtype ArrayRefOfMyCharOrDigit, as ArrayRef[MyChar|MyDigit];
30 coerce ArrayRefOfMyCharOrDigit, from Str, via {
36 BEGIN { TypeLib->import(qw/
37 MyChar MyDigit ArrayRefOfMyCharOrDigit/
39 use MooseX::Types::Moose 'ArrayRef';
41 my $parameterized = ArrayRef[MyChar|MyDigit];
42 { local $::TODO = "see comments in MooseX::Types->create_arged_...";
43 ::ok( $parameterized->has_coercion, 'coercion applied to parameterized type' );
46 my $subtype = ArrayRefOfMyCharOrDigit;
47 ::ok( $subtype->has_coercion, 'coercion applied to subtype' );