]> git.vpit.fr Git - perl/modules/subs-auto.git/blobdiff - t/11-pkg.t
Clarify what 'in' does with doc and tests
[perl/modules/subs-auto.git] / t / 11-pkg.t
index bd4ebb3504a069a73664e22e82e99557dcd24063..e97b7048c548a88ec27761e20696e2fd3b725feb 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 12;
+use Test::More tests => 16;
 
 our $foo;
 
@@ -21,6 +21,10 @@ our $foo;
   is($@, '', 'compiled to foo(3)');
   is($foo, 3, 'main::foo was really called');
 
+  eval { subs::auto::Test::Pkg::foo 4 };
+  is($@, '', 'compiled to subs::auto::Test::Pkg::foo(4)');
+  is($foo, 8, 'subs::auto::Test::Pkg::foo was really called');
+
   {
    package subs::auto::Test::Pkg;
 
@@ -35,6 +39,16 @@ our $foo;
  }
 }
 
+{
+ package subs::auto::Test::Pkg;
+
+ use subs::auto;
+
+ eval { foo 8 };
+ Test::More::is($@, '', 'compiled to foo(8)');
+ Test::More::is($foo, 16, 'subs::auto::Test::Pkg::foo was really called');
+}
+
 {
  use subs::auto in => '::';