| 1 | #!./perl
|
|---|
| 2 |
|
|---|
| 3 | BEGIN {
|
|---|
| 4 | chdir 't' if -d 't';
|
|---|
| 5 | @INC = '../lib';
|
|---|
| 6 | require Config;
|
|---|
| 7 | if (($Config::Config{'extensions'} !~ m!\bList/Util\b!) ){
|
|---|
| 8 | print "1..0 # Skip -- Perl configured without List::Util module\n";
|
|---|
| 9 | exit 0;
|
|---|
| 10 | }
|
|---|
| 11 | }
|
|---|
| 12 |
|
|---|
| 13 | use Test;
|
|---|
| 14 | BEGIN { plan tests => 10; }
|
|---|
| 15 |
|
|---|
| 16 | BEGIN {
|
|---|
| 17 | require autouse;
|
|---|
| 18 | eval {
|
|---|
| 19 | "autouse"->import('List::Util' => 'List::Util::first(&@)');
|
|---|
| 20 | };
|
|---|
| 21 | ok( !$@ );
|
|---|
| 22 |
|
|---|
| 23 | eval {
|
|---|
| 24 | "autouse"->import('List::Util' => 'Foo::min');
|
|---|
| 25 | };
|
|---|
| 26 | ok( $@, qr/^autouse into different package attempted/ );
|
|---|
| 27 |
|
|---|
| 28 | "autouse"->import('List::Util' => qw(max first(&@)));
|
|---|
| 29 | }
|
|---|
| 30 |
|
|---|
|
|---|