phase 1 of somewhat major rearrangement of PERL_OBJECT stuff
[p5sagit/p5-mst-13.2.git] / t / op / filetest.t
CommitLineData
42e55ab1 1#!./perl
2
3# There are few filetest operators that are portable enough to test.
4# See pod/perlport.pod for details.
5
6BEGIN {
7 chdir 't' if -d 't';
8}
9
10print "1..10\n";
11
12print "not " unless -d 'op';
13print "ok 1\n";
14
15print "not " unless -f 'TEST';
16print "ok 2\n";
17
18print "not " if -f 'op';
19print "ok 3\n";
20
21print "not " if -d 'TEST';
22print "ok 4\n";
23
24print "not " unless -r 'TEST';
25print "ok 5\n";
26
22c35a8c 27# make sure TEST is r-x
28eval { chmod 0555, 'TEST' };
29if ($@) {
30 print "#[$@]\nok 6 # skipped\n";
31}
32else {
33 print "not " if -w 'TEST';
34 print "ok 6\n";
35}
42e55ab1 36
37# Scripts are not -x everywhere.
38
39print "not " unless -r 'op';
40print "ok 7\n";
41
42print "not " unless -w 'op';
43print "ok 8\n";
44
45print "not " unless -x 'op'; # Hohum. Are directories -x everywhere?
46print "ok 9\n";
47
48print "not " unless "@{[grep -r, qw(foo io noo op zoo)]}" eq "io op";
49print "ok 10\n";