In IPC::Open3's fd.t, correct the code added in 1f563db471aa8a00.
authorNicholas Clark <nick@ccl4.org>
Fri, 4 Feb 2011 21:50:02 +0000 (21:50 +0000)
committerNicholas Clark <nick@ccl4.org>
Sun, 6 Feb 2011 08:24:19 +0000 (08:24 +0000)
C<q_Pie_> is not the same as C<q _Pie_> - the former is a bareword starting
with q, the latter a quoting operator. This error was hidden by the code added
in 45a1ce9706434aec to make the test "more forgiving of random stderr output".

Correct the description - fd 1 is STDOUT, not STDIN.

Win32 currently spits out a "Use of uninitialized value" warning, which we need
to take into account when checking that no error messages have been seen.

ext/IPC-Open3/t/fd.t

index a11c72a..0068576 100644 (file)
@@ -10,16 +10,23 @@ BEGIN {
 use strict;
 use warnings;
 
-plan 1;
+plan 2;
 
 # [perl #76474]
 {
   my $stderr = runperl(
      switches => ['-MIPC::Open3', '-w'],
-     prog => 'open3(q _<&1_, my $out, undef, $ENV{PERLEXE}, q_-e0_)',
+     prog => 'open3(q _<&1_, my $out, undef, $ENV{PERLEXE}, q _-e0_)',
      stderr => 1,
      stdin => '',
   );
-  unlike $stderr, qr/open3/,
-   "dup STDIN in a child process by using its file descriptor";
+  {
+      local $::TODO = "Bogus warning in IPC::Open3::spawn_with_handles"
+         if $^O eq 'MSWin32';
+      $stderr =~ s/(Use of uninitialized value.*Open3\.pm line \d+\.)\n//;
+      is($1, undef, 'No bogus warning found');
+  }
+
+  is $stderr, '',
+   "dup STDOUT in a child process by using its file descriptor";
 }