This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add test for filetests.
[perl5.git] / t / op / filetest.t
CommitLineData
42e55ab1
JH
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
27print "not " if -w 'TEST';
28print "ok 6\n";
29
30# Scripts are not -x everywhere.
31
32print "not " unless -r 'op';
33print "ok 7\n";
34
35print "not " unless -w 'op';
36print "ok 8\n";
37
38print "not " unless -x 'op'; # Hohum. Are directories -x everywhere?
39print "ok 9\n";
40
41print "not " unless "@{[grep -r, qw(foo io noo op zoo)]}" eq "io op";
42print "ok 10\n";