6 use Test::More tests => 16;
11 use subs::auto in => 'subs::auto::Test::Pkg';
13 eval { subs::auto::Test::Pkg::foo 5 };
14 is($@, '', 'compiled to subs::auto::Test::Pkg::foo(5)');
15 is($foo, 10, 'subs::auto::Test::Pkg::foo was really called');
21 is($@, '', 'compiled to foo(3)');
22 is($foo, 3, 'main::foo was really called');
24 eval { subs::auto::Test::Pkg::foo 4 };
25 is($@, '', 'compiled to subs::auto::Test::Pkg::foo(4)');
26 is($foo, 8, 'subs::auto::Test::Pkg::foo was really called');
29 package subs::auto::Test::Pkg;
32 Test::More::is($@, '', 'compiled to foo(7)');
33 Test::More::is($foo, 14, 'subs::auto::Test::Pkg::foo was really called');
36 Test::More::is($@, '', 'compiled to main::foo(9)');
37 Test::More::is($foo, 9, 'main::foo was really called');
43 package subs::auto::Test::Pkg;
48 Test::More::is($@, '', 'compiled to foo(8)');
49 Test::More::is($foo, 16, 'subs::auto::Test::Pkg::foo was really called');
53 use subs::auto in => '::';
56 is($@, '', 'compiled to foo(11)');
57 is($foo, 11, 'main::foo was really called');
61 package subs::auto::Test;
63 use subs::auto in => '::Pkg';
66 package subs::auto::Test::Pkg;
69 Test::More::is($@, '', 'compiled to foo(13)');
70 Test::More::is($foo, 26, 'subs::auto::Test::Pkg::foo was really called');
78 sub subs::auto::Test::Pkg::foo {
79 $main::foo = 2 * $_[0];