diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 1998-10-26 08:08:02 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 1998-10-26 08:08:02 +0000 |
commit | 42e55ab11744b52a291540f8d6f74cf67d4e6093 (patch) | |
tree | 8713612bf2e1b8ff5d1ba46f2a33bb1f121fa5f5 /t/op/filetest.t | |
parent | e5e1b98b7a55f8984e74bbc5d6484d24ab6375fa (diff) | |
download | perl-42e55ab11744b52a291540f8d6f74cf67d4e6093.tar.gz |
Add test for filetests.
p4raw-id: //depot/cfgperl@2087
Diffstat (limited to 't/op/filetest.t')
-rw-r--r-- | t/op/filetest.t | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/t/op/filetest.t b/t/op/filetest.t new file mode 100644 index 0000000000..d1332f0299 --- /dev/null +++ b/t/op/filetest.t @@ -0,0 +1,42 @@ +#!./perl + +# There are few filetest operators that are portable enough to test. +# See pod/perlport.pod for details. + +BEGIN { + chdir 't' if -d 't'; +} + +print "1..10\n"; + +print "not " unless -d 'op'; +print "ok 1\n"; + +print "not " unless -f 'TEST'; +print "ok 2\n"; + +print "not " if -f 'op'; +print "ok 3\n"; + +print "not " if -d 'TEST'; +print "ok 4\n"; + +print "not " unless -r 'TEST'; +print "ok 5\n"; + +print "not " if -w 'TEST'; +print "ok 6\n"; + +# Scripts are not -x everywhere. + +print "not " unless -r 'op'; +print "ok 7\n"; + +print "not " unless -w 'op'; +print "ok 8\n"; + +print "not " unless -x 'op'; # Hohum. Are directories -x everywhere? +print "ok 9\n"; + +print "not " unless "@{[grep -r, qw(foo io noo op zoo)]}" eq "io op"; +print "ok 10\n"; |