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