summaryrefslogtreecommitdiff
path: root/t/io.inplace
diff options
context:
space:
mode:
Diffstat (limited to 't/io.inplace')
-rw-r--r--t/io.inplace19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/io.inplace b/t/io.inplace
new file mode 100644
index 0000000000..2a245306c9
--- /dev/null
+++ b/t/io.inplace
@@ -0,0 +1,19 @@
+#!./perl -i.bak
+
+# $Header: io.inplace,v 1.0 87/12/18 13:12:51 root 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';