Change 32997 missed one conditionally unused argument.
[p5sagit/p5-mst-13.2.git] / t / io / inplace.t
1 #!./perl
2 use strict;
3 require './test.pl';
4
5 $^I = $^O eq 'VMS' ? '_bak' : '.bak';
6
7 plan( tests => 2 );
8
9 my @tfiles     = ('.a','.b','.c');
10 my @tfiles_bak = (".a$^I", ".b$^I", ".c$^I");
11
12 END { unlink_all('.a','.b','.c',".a$^I", ".b$^I", ".c$^I"); }
13
14 for my $file (@tfiles) {
15     runperl( prog => 'print qq(foo\n);', 
16              args => ['>', $file] );
17 }
18
19 @ARGV = @tfiles;
20
21 while (<>) {
22     s/foo/bar/;
23 }
24 continue {
25     print;
26 }
27
28 is ( runperl( prog => 'print<>;', args => \@tfiles ), 
29      "bar\nbar\nbar\n", 
30      "file contents properly replaced" );
31
32 is ( runperl( prog => 'print<>;', args => \@tfiles_bak ), 
33      "foo\nfoo\nfoo\n", 
34      "backup file contents stay the same" );
35