Be more explicit testing for \015 not \r
[p5sagit/p5-mst-13.2.git] / t / io / inplace.t
CommitLineData
fe14fcc3 1#!./perl
8d063cd8 2
103a9d15 3$^I = $^O eq 'VMS' ? '_bak' : '.bak';
fe14fcc3 4
79072805 5# $RCSfile: inplace.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:29 $
8d063cd8 6
7print "1..2\n";
8
9@ARGV = ('.a','.b','.c');
68dc0745 10if ($^O eq 'MSWin32') {
11 $CAT = '.\perl -e "print<>"';
12 `.\\perl -le "print 'foo'" > .a`;
13 `.\\perl -le "print 'foo'" > .b`;
14 `.\\perl -le "print 'foo'" > .c`;
15}
2986a63f 16elsif ($^O eq 'NetWare') {
17 $CAT = 'perl -e "print<>"';
18 `perl -le "print 'foo'" > .a`;
19 `perl -le "print 'foo'" > .b`;
20 `perl -le "print 'foo'" > .c`;
21}
103a9d15 22elsif ($^O eq 'VMS') {
23 $CAT = 'MCR []perl. -e "print<>"';
24 `MCR []perl. -le "print 'foo'" > ./.a`;
25 `MCR []perl. -le "print 'foo'" > ./.b`;
26 `MCR []perl. -le "print 'foo'" > ./.c`;
27}
68dc0745 28else {
29 $CAT = 'cat';
30 `echo foo | tee .a .b .c`;
31}
8d063cd8 32while (<>) {
33 s/foo/bar/;
34}
35continue {
36 print;
37}
38
68dc0745 39if (`$CAT .a .b .c` eq "bar\nbar\nbar\n") {print "ok 1\n";} else {print "not ok 1\n";}
103a9d15 40if (`$CAT .a$^I .b$^I .c$^I` eq "foo\nfoo\nfoo\n") {print "ok 2\n";} else {print "not ok 2\n";}
8d063cd8 41
9949743f 42unlink '.a', '.b', '.c', ".a$^I", ".b$^I", ".c$^I";