summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/perl/t/io/inplace.t
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/perl/perl/t/io/inplace.t')
-rwxr-xr-xgnu/usr.bin/perl/perl/t/io/inplace.t21
1 files changed, 21 insertions, 0 deletions
diff --git a/gnu/usr.bin/perl/perl/t/io/inplace.t b/gnu/usr.bin/perl/perl/t/io/inplace.t
new file mode 100755
index 000000000000..b22afdaa4b98
--- /dev/null
+++ b/gnu/usr.bin/perl/perl/t/io/inplace.t
@@ -0,0 +1,21 @@
+#!./perl
+
+$^I = '.bak';
+
+# $Header: /home/cvs/386BSD/ports/lang/perl/t/io/inplace.t,v 1.1.1.1 1993/08/23 21:30:05 nate Exp $
+
+print "1..2\n";
+
+@ARGV = ('.a','.b','.c');
+`echo foo | tee .a .b .c`;
+while (<>) {
+ s/foo/bar/;
+}
+continue {
+ print;
+}
+
+if (`cat .a .b .c` eq "bar\nbar\nbar\n") {print "ok 1\n";} else {print "not ok 1\n";}
+if (`cat .a.bak .b.bak .c.bak` eq "foo\nfoo\nfoo\n") {print "ok 2\n";} else {print "not ok 2\n";}
+
+unlink '.a', '.b', '.c', '.a.bak', '.b.bak', '.c.bak';