5 use Test::More tests => 2;
8 use lib "$FindBin::Bin/lib";
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 );
18 sub NotAType () { 'just a string' }
22 IntrospectTypeExports->import(__PACKAGE__, qw( NotAType ));
24 ::ok(!$@, "introspecting something that's not not a type doesn't blow up");
29 delete ${'IntrospectionTest::'}{TwentyThree};
33 use IntrospectTypeExports IntrospectionTest => qw( TwentyThree NonEmptyStr MyNonEmptyStr );
35 my $P = 'IntrospectionTest';
37 is_deeply(IntrospectTypeExports->get_memory, [
39 [$P, TwentyThree => undef],
40 [$P, NonEmptyStr => undef],
41 [$P, MyNonEmptyStr => undef],
43 [$P, TwentyThree => 'TestLibrary::TwentyThree'],
44 [$P, NonEmptyStr => undef],
45 [$P, MyNonEmptyStr => undef],
47 [$P, TwentyThree => 'TestLibrary::TwentyThree'],
48 [$P, NonEmptyStr => undef],
49 [$P, MyNonEmptyStr => 'TestLibrary::NonEmptyStr'],
51 [$P, NotAType => undef],
53 [$P, TwentyThree => undef],
54 [$P, NonEmptyStr => undef],
55 [$P, MyNonEmptyStr => 'TestLibrary::NonEmptyStr'],
57 ], 'all calls to has_available_type_export returned correct results');