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 ok my $dummy_instance = Test::Moose::Meta::TypeConstraint::Union->new
34 => "Created Instance";
36 isa_ok $dummy_instance, 'Test::Moose::Meta::TypeConstraint::Union'
37 => 'isa correct type';
39 is "$dummy_instance", "Broken|Test"
40 => "Got expected stringification result";
42 ok my $subtype1 = subtype('New1', as $dummy_instance)
45 ok my $subtype2 = subtype('New2', as $subtype1)
46 => "made another subtype";