From: Jarkko Hietaniemi Date: Mon, 26 Oct 1998 08:08:02 +0000 (+0000) Subject: Add test for filetests. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=42e55ab11744b52a291540f8d6f74cf67d4e6093;p=p5sagit%2Fp5-mst-13.2.git Add test for filetests. p4raw-id: //depot/cfgperl@2087 --- diff --git a/MANIFEST b/MANIFEST index 63348a3..a458adc 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1068,6 +1068,7 @@ t/op/each.t See if hash iterators work t/op/eval.t See if eval operator works t/op/exec.t See if exec and system work t/op/exp.t See if math functions work +t/op/filetest.t See if file tests work t/op/flip.t See if range operator works t/op/fork.t See if fork works t/op/glob.t See if <*> works diff --git a/t/op/filetest.t b/t/op/filetest.t new file mode 100644 index 0000000..d1332f0 --- /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";