-use strictures 1;
+use strictures 2;
use Test::More;
use Test::Fatal;
use Package::Variant ();
is_deeply [@imported], [qw( TestImportableA )],
'scalar import works';
+@imported = ();
+
+TestSingleImport::->build_variant;
+
+is_deeply [@imported], [qw( TestImportableA )],
+ 'build_variant works';
+
like exception {
Package::Variant->import(
importing => \'foo', subs => [qw( foo )],
);
}, qr/value.+2.+foo.+importing.+array/i, 'importing array invalid list';
+BEGIN {
+ package TestOverrideName;
+
+ use Package::Variant;
+
+ sub make_variant_package_name {
+ my (undef, @args) = @_;
+ return $args[0];
+ }
+
+ sub make_variant {
+ install hey => sub { 'hey' };
+ }
+}
+
+is(TestOverrideName::->build_variant('hey'), 'hey');
+
+is(hey->hey, 'hey', 'hey');
+
done_testing;