]> git.vpit.fr Git - perl/modules/indirect.git/blobdiff - t/10-good.t
Fix a rare edge case for package whose names are prefix of 'main'
[perl/modules/indirect.git] / t / 10-good.t
index 0132f45ec4ac6ea96569815a5c843706ac071c22..708397f73a9cd44126c4532acfd8af1b1edd1147 100644 (file)
@@ -9,15 +9,17 @@ package main;
 use strict;
 use warnings;
 
-use Test::More tests => 36 * 4;
+use Test::More tests => 49 * 4;
 
-my ($obj, $pkg, $cb, $x);
+my ($obj, $pkg, $cb, $x, @a);
+our $y;
 sub meh;
 
 {
  local $/ = "####\n";
  while (<DATA>) {
   chomp;
+  s/\s*$//;
   local $SIG{__WARN__} = sub { die 'warn:' . join(' ', @_) };
   {
    use indirect;
@@ -129,14 +131,32 @@ $obj = new
       $x
     }(qw/bar baz/);
 ####
+meh;
+####
+meh $_;
+####
 meh $x;
 ####
-meh $x, 1 , 2;
+meh $x, 1, 2;
 ####
-print STDOUT "bananananananana\n";
+meh $y;
+####
+meh $y, 1, 2;
+####
+print;
+####
+print $_;
+####
+print $x;
 ####
 print $x "oh hai\n";
 ####
+print $y;
+####
+print $y "dongs\n";
+####
+print STDOUT "bananananananana\n";
+####
 $x->foo($pkg->$cb)
 ####
 $obj = "apple ${\(new Hlagh)} pear"
@@ -144,3 +164,11 @@ $obj = "apple ${\(new Hlagh)} pear"
 $obj = "apple @{[new Hlagh]} pear"
 ####
 s/dongs/new Hlagh/e;
+####
+exec $x $x, @a;
+####
+exec { $a[0] } @a;
+####
+system $x $x, @a;
+####
+system { $a[0] } @a;