earlier error reporting, with tests
[p5sagit/Package-Variant.git] / t / 01simple.t
index 2d51873..e41d27f 100644 (file)
@@ -72,8 +72,8 @@ BEGIN {
   package TestArrayImports;
   use Package::Variant
     importing => [
-      TestImportableA => undef,
-      TestImportableB => undef,
+      'TestImportableA',
+      'TestImportableB',
     ];
   sub make_variant { }
   $INC{'TestArrayImports.pm'} = __FILE__;
@@ -85,4 +85,16 @@ TestArrayImports(23);
 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;