X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F16_introspection.t;h=f2f04e4525cc36a66b4cd239ab5f76979ea71c6c;hb=c15335068eb0937d46e85ef57af110dc64257326;hp=da39992e5ffdd3b2c0f633efc66a97871675c549;hpb=e50bf0d982a7e75adb8106c092080d06cee427c3;p=gitmo%2FMooseX-Types.git diff --git a/t/16_introspection.t b/t/16_introspection.t index da39992..f2f04e4 100644 --- a/t/16_introspection.t +++ b/t/16_introspection.t @@ -2,7 +2,7 @@ use strict; use warnings; -use Test::More tests => 1; +use Test::More; use FindBin; use lib "$FindBin::Bin/lib"; @@ -14,6 +14,16 @@ do { use IntrospectTypeExports __PACKAGE__, qw( TwentyThree NonEmptyStr MyNonEmptyStr ); use TestLibrary NonEmptyStr => { -as => 'MyNonEmptyStr' }; use IntrospectTypeExports __PACKAGE__, qw( TwentyThree NonEmptyStr MyNonEmptyStr ); + + sub NotAType () { 'just a string' } + + BEGIN { + eval { + IntrospectTypeExports->import(__PACKAGE__, qw( NotAType )); + }; + ::ok(!$@, "introspecting something that's not not a type doesn't blow up"); + } + BEGIN { no strict 'refs'; delete ${'IntrospectionTest::'}{TwentyThree}; @@ -38,9 +48,12 @@ is_deeply(IntrospectTypeExports->get_memory, [ [$P, NonEmptyStr => undef], [$P, MyNonEmptyStr => 'TestLibrary::NonEmptyStr'], + [$P, NotAType => undef], + [$P, TwentyThree => undef], [$P, NonEmptyStr => undef], [$P, MyNonEmptyStr => 'TestLibrary::NonEmptyStr'], ], 'all calls to has_available_type_export returned correct results'); +done_testing();