Fix test fail by adding t/lib to @INC.
[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
1616a2ca 8use FindBin;
9use lib "$FindBin::Bin/lib";
10
5885c4f4 11do {
12 package IntrospectionTest;
13 use IntrospectTypeExports __PACKAGE__, qw( TwentyThree NonEmptyStr MyNonEmptyStr );
14 use TestLibrary qw( TwentyThree );
15 use IntrospectTypeExports __PACKAGE__, qw( TwentyThree NonEmptyStr MyNonEmptyStr );
16 use TestLibrary NonEmptyStr => { -as => 'MyNonEmptyStr' };
17 use IntrospectTypeExports __PACKAGE__, qw( TwentyThree NonEmptyStr MyNonEmptyStr );
18 BEGIN {
19 no strict 'refs';
20 delete ${'IntrospectionTest::'}{TwentyThree};
21 }
22};
23
24use IntrospectTypeExports IntrospectionTest => qw( TwentyThree NonEmptyStr MyNonEmptyStr );
25
26my $P = 'IntrospectionTest';
27
28is_deeply(IntrospectTypeExports->get_memory, [
29
30 [$P, TwentyThree => undef],
31 [$P, NonEmptyStr => undef],
32 [$P, MyNonEmptyStr => undef],
33
34 [$P, TwentyThree => 'TestLibrary::TwentyThree'],
35 [$P, NonEmptyStr => undef],
36 [$P, MyNonEmptyStr => undef],
37
38 [$P, TwentyThree => 'TestLibrary::TwentyThree'],
39 [$P, NonEmptyStr => undef],
40 [$P, MyNonEmptyStr => 'TestLibrary::NonEmptyStr'],
41
42 [$P, TwentyThree => undef],
43 [$P, NonEmptyStr => undef],
44 [$P, MyNonEmptyStr => 'TestLibrary::NonEmptyStr'],
45
46], 'all calls to has_available_type_export returned correct results');
47