3 # try to honor possible tempdirs
12 This is a much longer bit of contents
20 &write_file($tmp, $long);
21 if (&read_file($tmp) eq $long) {print "ok 1\n";} else {print "not ok 1\n";}
23 @x = &read_file($tmp);
24 @y = grep( $_ ne '', split(/(.*?\n)/, $long));
26 last unless $x[0] eq $y[0];
30 if (@x == @y && (@x ? $x[0] eq $y[0] : 1)) { print "ok 2\n";} else {print "not ok 2\n"}
32 &append_file($tmp, $short);
33 if (&read_file($tmp) eq "$long$short") {print "ok 3\n";} else {print "not ok 3\n";}
35 $iold = (stat($tmp))[1];
36 &overwrite_file($tmp, $short);
37 $inew = (stat($tmp))[1];
39 if (&read_file($tmp) eq $short) {print "ok 4\n";} else {print "not ok 4\n";}
41 if ($inew == $iold) {print "ok 5\n";} else {print "not ok 5\n";}
45 &overwrite_file($tmp, $long);
46 if (&read_file($tmp) eq $long) {print "ok 6\n";} else {print "not ok 6\n";}
50 &append_file($tmp, $short);
51 if (&read_file($tmp) eq $short) {print "ok 7\n";} else {print "not ok 7\n";}