2 use warnings FATAL => 'all';
3 use Test::More qw(no_plan);
11 our @EXPORT_OK = qw(thing);
15 package MultiExporter;
21 warnings->import::into($target);
22 MyExporter->import::into($target, 'thing');
23 CheckFile->import::into(1);
27 $INC{"MultiExporter.pm"} = 1;
37 @checkcaller = caller;
40 $checkversion = $_[1];
43 $INC{"CheckFile.pm"} = 1;
63 local $SIG{__WARN__} = sub { push @w, @_; };
65 }, 'thing', 'returned thing ok');
67 is(scalar @w, 1, 'Only one entry in @w');
69 like($w[0], qr/uninitialized/, 'Correct warning');
71 is $checkcaller[0], 'TestPackage', 'import by level has correct package';
72 is $checkcaller[1], __FILE__, 'import by level has correct file';
73 is $checkcaller[2], 1, 'import by level has correct line';
75 CheckFile->import::into({
76 package => 'ExplicitPackage',
77 filename => 'explicit-file.pl',
82 is $checkcaller[0], 'ExplicitPackage', 'import with hash has correct package';
83 is $checkcaller[1], 'explicit-file.pl', 'import with hash has correct file';
84 is $checkcaller[2], 42, 'import with hash has correct line';
85 is $checkversion, 219, 'import with hash has correct version';