We only need local $? if we inline calls to DEMOLISH
[gitmo/Moose.git] / t / type_constraints / util_type_constraints_export.t
CommitLineData
a15dff8d 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
a28e50e4 6use Test::More;
a15dff8d 7
a15dff8d 8{
9 package Foo;
10
3860f446 11 use Moose::Util::TypeConstraints;
12
1a2cafee 13 eval {
14 type MyRef => where { ref($_) };
15 };
16 ::ok( !$@, '... successfully exported &type to Foo package' );
17
18 eval {
19 subtype MyArrayRef => as MyRef => where { ref($_) eq 'ARRAY' };
20 };
21 ::ok( !$@, '... successfully exported &subtype to Foo package' );
22
23 Moose::Util::TypeConstraints->export_type_constraints_as_functions();
24
25 ::ok( MyRef( {} ), '... Ref worked correctly' );
26 ::ok( MyArrayRef( [] ), '... ArrayRef worked correctly' );
27}
a28e50e4 28
29done_testing;