4 use Test::More tests=>4;
7 use_ok 'Moose::Util::TypeConstraints';
8 use_ok 'MooseX::Meta::TypeConstraint::Structured::Positionable';
11 ok my $REGISTRY = Moose::Meta::TypeConstraint::Registry->new
14 my $tuple = MooseX::Meta::TypeConstraint::Structured::Positionable->new(
16 package_defined_in => __PACKAGE__,
17 parent => find_type_constraint('Ref'),
21 type('Tuple', $tuple);
26 use Data::Dump qw/dump/;
27 #warn dump sort {$a cmp $b} Moose::Util::TypeConstraints::list_all_type_constraints;
31 package Test::MooseX::Types::Structured::Positionable;
34 has 'attr' => (is=>'rw', isa=>'Tuple[Int,Str,Int]');
38 ok my $positioned_obj = Test::MooseX::Types::Structured::Positionable->new,
39 => 'Got a good object';
42 $positioned_obj->attr([1,'hello',3]);
45 $positioned_obj->attr([1,2,'world']);
46 $positioned_obj->attr(['hello',2,3]);
47 $positioned_obj->attr(['hello',2,'world']);