[patch] more about embed.fnc in perlguts
[p5sagit/p5-mst-13.2.git] / t / run / runenv.t
index f3a5a06..7359c4e 100644 (file)
@@ -20,7 +20,7 @@ plan tests => 17;
 
 my $STDOUT = './results-0';
 my $STDERR = './results-1';
-my $PERL = './perl';
+my $PERL = $ENV{PERL} || './perl';
 my $FAILURE_CODE = 119;
 
 delete $ENV{PERLLIB};
@@ -39,6 +39,10 @@ sub runperl {
 
   $stdout = '' unless defined $stdout;
   $stderr = '' unless defined $stderr;
+  local %ENV = %ENV;
+  delete $ENV{PERLLIB};
+  delete $ENV{PERL5LIB};
+  delete $ENV{PERL5OPT};
   my $pid = fork;
   return (0, "Couldn't fork: $!") unless defined $pid;   # failure
   if ($pid) {                   # parent
@@ -93,7 +97,7 @@ sub try {
 
 try({PERL5OPT => '-w'}, ['-e', 'print $::x'],
     "", 
-    qq{Name "main::x" used only once: possible typo at -e line 1.\nUse of uninitialized value in print at -e line 1.\n});
+    qq{Name "main::x" used only once: possible typo at -e line 1.\nUse of uninitialized value \$x in print at -e line 1.\n});
 
 try({PERL5OPT => '-Mstrict'}, ['-e', 'print $::x'],
     "", "");
@@ -112,7 +116,7 @@ try({PERL5OPT => '-w -Mstrict'}, ['-e', 'print $::x'],
     "", 
     <<ERROR
 Name "main::x" used only once: possible typo at -e line 1.
-Use of uninitialized value in print at -e line 1.
+Use of uninitialized value \$x in print at -e line 1.
 ERROR
     );
 
@@ -121,7 +125,7 @@ try({PERL5OPT => '-w -Mstrict'}, ['-e', 'print $::x'],
     "", 
     <<ERROR
 Name "main::x" used only once: possible typo at -e line 1.
-Use of uninitialized value in print at -e line 1.
+Use of uninitialized value \$x in print at -e line 1.
 ERROR
     );
 
@@ -146,25 +150,25 @@ try({PERL5OPT => '-w -w'},
 
 try({PERL5OPT => '-t'},
     ['-e', 'print ${^TAINT}'],
-    '1',
+    '-1',
     '');
 
-try({PERLLIB => "foobar:42"},
+try({PERLLIB => "foobar$Config{path_sep}42"},
     ['-e', 'print grep { $_ eq "foobar" } @INC'],
     'foobar',
     '');
 
-try({PERLLIB => "foobar:42"},
+try({PERLLIB => "foobar$Config{path_sep}42"},
     ['-e', 'print grep { $_ eq "42" } @INC'],
     '42',
     '');
 
-try({PERL5LIB => "foobar:42"},
+try({PERL5LIB => "foobar$Config{path_sep}42"},
     ['-e', 'print grep { $_ eq "foobar" } @INC'],
     'foobar',
     '');
 
-try({PERL5LIB => "foobar:42"},
+try({PERL5LIB => "foobar$Config{path_sep}42"},
     ['-e', 'print grep { $_ eq "42" } @INC'],
     '42',
     '');