6 use Test::More tests => 8;
10 use_ok('Moose::Util::TypeConstraints');
13 # subtype 'aliasing' ...
16 subtype 'Numb3rs' => as 'Num';
17 } '... create bare subtype fine';
19 my $numb3rs = find_type_constraint('Numb3rs');
20 isa_ok($numb3rs, 'Moose::Meta::TypeConstraint');
25 package Test::Moose::Meta::TypeConstraint::Union;
27 use overload '""' => sub {'Broken|Test'}, fallback => 1;
30 extends 'Moose::Meta::TypeConstraint';
33 my $dummy_instance = Test::Moose::Meta::TypeConstraint::Union->new;
35 ok $dummy_instance => "Created Instance";
37 isa_ok $dummy_instance,
38 'Test::Moose::Meta::TypeConstraint::Union' => 'isa correct type';
40 is "$dummy_instance", "Broken|Test" =>
41 'Got expected stringification result';
43 my $subtype1 = subtype 'New1' => as $dummy_instance;
45 ok $subtype1 => 'made a subtype from our type object';
47 my $subtype2 = subtype 'New2' => as $subtype1;
49 ok $subtype2 => 'made a subtype of our subtype';