From: Robert Sedlacek Date: Mon, 28 Nov 2011 21:58:43 +0000 (+0100) Subject: tests for array ref importing X-Git-Tag: v1.000000~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=815b5be2c946367c4d74c815599ea9d706c0f5e3;p=p5sagit%2FPackage-Variant.git tests for array ref importing --- diff --git a/t/01simple.t b/t/01simple.t index 6cb6406..2d51873 100644 --- a/t/01simple.t +++ b/t/01simple.t @@ -61,4 +61,28 @@ is exception { is_deeply $renamed->args, [9..12], 'imported generator can be renamed'; }, undef, 'no errors for renamed usage'; +my @imported; +BEGIN { + package TestImportableA; + sub import { push @imported, shift } + $INC{'TestImportableA.pm'} = __FILE__; + package TestImportableB; + sub import { push @imported, shift } + $INC{'TestImportableB.pm'} = __FILE__; + package TestArrayImports; + use Package::Variant + importing => [ + TestImportableA => undef, + TestImportableB => undef, + ]; + sub make_variant { } + $INC{'TestArrayImports.pm'} = __FILE__; +} + +use TestArrayImports; +TestArrayImports(23); + +is_deeply [@imported], [qw( TestImportableA TestImportableB )], + 'multiple imports in the right order'; + done_testing;