d1332f02991ea9bf468cf0dcd2b5f532ef97d24d
[p5sagit/p5-mst-13.2.git] / t / op / filetest.t
1 #!./perl
2
3 # There are few filetest operators that are portable enough to test.
4 # See pod/perlport.pod for details.
5
6 BEGIN {
7     chdir 't' if -d 't';
8 }
9
10 print "1..10\n";
11
12 print "not " unless -d 'op';
13 print "ok 1\n";
14
15 print "not " unless -f 'TEST';
16 print "ok 2\n";
17
18 print "not " if -f 'op';
19 print "ok 3\n";
20
21 print "not " if -d 'TEST';
22 print "ok 4\n";
23
24 print "not " unless -r 'TEST';
25 print "ok 5\n";
26
27 print "not " if -w 'TEST';
28 print "ok 6\n";
29
30 # Scripts are not -x everywhere.
31
32 print "not " unless -r 'op';
33 print "ok 7\n";
34
35 print "not " unless -w 'op';
36 print "ok 8\n";
37
38 print "not " unless -x 'op'; # Hohum.  Are directories -x everywhere?
39 print "ok 9\n";
40
41 print "not " unless "@{[grep -r, qw(foo io noo op zoo)]}" eq "io op";
42 print "ok 10\n";