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