diff options
author | Nicholas Clark <nick@ccl4.org> | 2014-02-27 10:56:11 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2014-03-02 07:08:54 +0100 |
commit | 3830cb7e9974e7471c7c3b0eb12e170a79dd55c3 (patch) | |
tree | 81efc02d334628744c7027d210b5a382237437ef | |
parent | a5bd6593733644fa5dea102b5dc5660137543b0f (diff) | |
download | perl-3830cb7e9974e7471c7c3b0eb12e170a79dd55c3.tar.gz |
Change the test to use itself as test file, instead of the generated Makefile.
The generated Makefile is about to go away :-)
-rw-r--r-- | ext/IPC-Open3/t/fd.t | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/ext/IPC-Open3/t/fd.t b/ext/IPC-Open3/t/fd.t index 4e2742714d..2a71b1387c 100644 --- a/ext/IPC-Open3/t/fd.t +++ b/ext/IPC-Open3/t/fd.t @@ -1,4 +1,4 @@ -#!./perl +#!./perl -- # Perl Rules BEGIN { if ($^O eq 'VMS') { @@ -12,11 +12,13 @@ use warnings; plan 3; + my $file = 't/fd.t'; + # [perl #76474] { my $stderr = runperl( switches => ['-MIPC::Open3', '-w'], - prog => 'open STDIN, q _Makefile_ or die $!; open3(q _<&0_, my $out, undef, $ENV{PERLEXE}, q _-e0_)', + prog => "open STDIN, q _${file}_ or die \$!; open3(q _<&0_, my \$out, undef, \$ENV{PERLEXE}, q _-e0_)", stderr => 1, ); @@ -25,18 +27,18 @@ plan 3; } { - my $want = qr/\A# This Makefile is for the IPC::Open3 extension to perl\.\r?\z/; - open my $fh, '<', 'Makefile' or die "Can't open MAKEFILE: $!"; + my $want = qr{\A#!\./perl -- # Perl Rules\r?\z}; + open my $fh, '<', $file or die "Can't open $file: $!"; my $have = <$fh>; chomp $have; - like($have, $want, 'No surprises from MakeMaker'); + like($have, $want, 'We can find our test string'); close $fh; - fresh_perl_like(<<'EOP', + fresh_perl_like(<<"EOP", use IPC::Open3; -open FOO, 'Makefile' or die $!; -open3('<&' . fileno FOO, my $out, undef, $ENV{PERLEXE}, '-eprint scalar <STDIN>'); -print <$out>; +open FOO, '$file' or die \$!; +open3('<&' . fileno FOO, my \$out, undef, \$ENV{PERLEXE}, '-eprint scalar <STDIN>'); +print <\$out>; EOP $want, undef, |