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;
50 no warnings FATAL => 'all';
52 #line 1 "import_into_inline.pl"
64 local $SIG{__WARN__} = sub { push @w, @_; };
66 }, 'thing', 'returned thing ok');
68 is(scalar @w, 1, 'Only one entry in @w');
70 like($w[0], qr/uninitialized/, 'Correct warning');
72 is $checkcaller[0], 'TestPackage', 'import by level has correct package';
73 is $checkcaller[1], 'import_into_inline.pl', 'import by level has correct file';
74 is $checkcaller[2], 1, 'import by level has correct line';
76 CheckFile->import::into({
77 package => 'ExplicitPackage',
78 filename => 'explicit-file.pl',
83 is $checkcaller[0], 'ExplicitPackage', 'import with hash has correct package';
84 is $checkcaller[1], 'explicit-file.pl', 'import with hash has correct file';
85 is $checkcaller[2], 42, 'import with hash has correct line';
86 is $checkversion, 219, 'import with hash has correct version';