5 use Test::More tests => 2;
9 use MooseX::Types -declare => [qw/
10 MyChar MyDigit ArrayRefOfMyCharOrDigit
12 use MooseX::Types::Moose qw/ArrayRef Str Int/;
14 subtype MyChar, as Str, where {
18 subtype MyDigit, as Int, where {
22 coerce ArrayRef[MyChar|MyDigit], from Str, via {
26 # same thing with an explicit subtype
27 subtype ArrayRefOfMyCharOrDigit, as ArrayRef[MyChar|MyDigit];
29 coerce ArrayRefOfMyCharOrDigit, from Str, via {
35 BEGIN { TypeLib->import(qw/
36 MyChar MyDigit ArrayRefOfMyCharOrDigit/
38 use MooseX::Types::Moose 'ArrayRef';
40 my $parameterized = ArrayRef[MyChar|MyDigit];
41 { local $::TODO = "see comments in MooseX::Types->create_arged_...";
42 ::ok( $parameterized->has_coercion, 'coercion applied to parameterized type' );
45 my $subtype = ArrayRefOfMyCharOrDigit;
46 ::ok( $subtype->has_coercion, 'coercion applied to subtype' );