Commit | Line | Data |
---|---|---|
3eb568f1 | 1 | #!./perl |
2 | ||
3 | # $RCSfile$ | |
853846ea | 4 | $| = 1; |
5 | $^W = 1; | |
3eb568f1 | 6 | |
1d8d4d2a | 7 | print "1..9\n"; |
3eb568f1 | 8 | |
853846ea | 9 | # my $file tests |
10 | ||
11 | unlink("afile.new") if -f "afile"; | |
12 | print "$!\nnot " unless open(my $f,"+>afile"); | |
3eb568f1 | 13 | print "ok 1\n"; |
853846ea | 14 | print "not " unless -f "afile"; |
3eb568f1 | 15 | print "ok 2\n"; |
853846ea | 16 | print "not " unless print $f "SomeData\n"; |
3eb568f1 | 17 | print "ok 3\n"; |
853846ea | 18 | print "not " unless tell($f) == 9; |
3eb568f1 | 19 | print "ok 4\n"; |
853846ea | 20 | print "not " unless seek($f,0,0); |
3eb568f1 | 21 | print "ok 5\n"; |
853846ea | 22 | $b = <$f>; |
23 | print "not " unless $b eq "SomeData\n"; | |
3eb568f1 | 24 | print "ok 6\n"; |
853846ea | 25 | print "not " unless -f $f; |
26 | print "ok 7\n"; | |
27 | eval { die "Message" }; | |
28 | # warn $@; | |
29 | print "not " unless $@ =~ /<\$f> line 1/; | |
30 | print "ok 8\n"; | |
31 | print "not " unless close($f); | |
32 | print "ok 9\n"; | |
33 | unlink("afile"); | |
3eb568f1 | 34 |