X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F16_introspection.t;h=b4821e373490c099ccbbb316025b486db4d898bf;hb=6cfbfdbc099ddc95835bfb05384d36c9eba7e527;hp=da39992e5ffdd3b2c0f633efc66a97871675c549;hpb=e50bf0d982a7e75adb8106c092080d06cee427c3;p=gitmo%2FMooseX-Types.git diff --git a/t/16_introspection.t b/t/16_introspection.t index da39992..b4821e3 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 tests => 2; 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,6 +48,8 @@ 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'],