package TestArrayImports;
use Package::Variant
importing => [
- TestImportableA => undef,
- TestImportableB => undef,
+ 'TestImportableA',
+ 'TestImportableB',
];
sub make_variant { }
$INC{'TestArrayImports.pm'} = __FILE__;
is_deeply [@imported], [qw( TestImportableA TestImportableB )],
'multiple imports in the right order';
+like exception {
+ Package::Variant->import(
+ importing => \'foo', subs => [qw( foo )],
+ );
+}, qr/importing.+option.+hash.+array/i, 'invalid "importing" option';
+
+like exception {
+ Package::Variant->import(
+ importing => { foo => \'bar' }, subs => [qw( bar )],
+ );
+}, qr/import.+argument.+not.+array/i, 'invalid import argument list';
+
done_testing;