added has_available_type_export introspection utility function
[gitmo/MooseX-Types.git] / t / 16_introspection.t
CommitLineData
5885c4f4 1#!/usr/bin/env perl
2use strict;
3use warnings;
4
5use Data::Dump qw( pp );
6use Test::More tests => 1;
7
8do {
9 package IntrospectionTest;
10 use IntrospectTypeExports __PACKAGE__, qw( TwentyThree NonEmptyStr MyNonEmptyStr );
11 use TestLibrary qw( TwentyThree );
12 use IntrospectTypeExports __PACKAGE__, qw( TwentyThree NonEmptyStr MyNonEmptyStr );
13 use TestLibrary NonEmptyStr => { -as => 'MyNonEmptyStr' };
14 use IntrospectTypeExports __PACKAGE__, qw( TwentyThree NonEmptyStr MyNonEmptyStr );
15 BEGIN {
16 no strict 'refs';
17 delete ${'IntrospectionTest::'}{TwentyThree};
18 }
19};
20
21use IntrospectTypeExports IntrospectionTest => qw( TwentyThree NonEmptyStr MyNonEmptyStr );
22
23my $P = 'IntrospectionTest';
24
25is_deeply(IntrospectTypeExports->get_memory, [
26
27 [$P, TwentyThree => undef],
28 [$P, NonEmptyStr => undef],
29 [$P, MyNonEmptyStr => undef],
30
31 [$P, TwentyThree => 'TestLibrary::TwentyThree'],
32 [$P, NonEmptyStr => undef],
33 [$P, MyNonEmptyStr => undef],
34
35 [$P, TwentyThree => 'TestLibrary::TwentyThree'],
36 [$P, NonEmptyStr => undef],
37 [$P, MyNonEmptyStr => 'TestLibrary::NonEmptyStr'],
38
39 [$P, TwentyThree => undef],
40 [$P, NonEmptyStr => undef],
41 [$P, MyNonEmptyStr => 'TestLibrary::NonEmptyStr'],
42
43], 'all calls to has_available_type_export returned correct results');
44