diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-01-09 22:36:21 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-01-09 22:36:21 +0000 |
commit | 89eb5450df838ee8565c99567ce367f194dbe60f (patch) | |
tree | 850c4093a644b907af5b3e61774353c7017b2b39 /t/op/readdir.t | |
parent | 036846d3cb5fd43e75de71347d8307e819ae6788 (diff) | |
download | perl-89eb5450df838ee8565c99567ce367f194dbe60f.tar.gz |
grep the MANIFEST to avoid having hard coded numbers in readdir.t
p4raw-id: //depot/perl@32930
Diffstat (limited to 't/op/readdir.t')
-rwxr-xr-x | t/op/readdir.t | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/t/op/readdir.t b/t/op/readdir.t index 971a02ada7..53c7b68c27 100755 --- a/t/op/readdir.t +++ b/t/op/readdir.t @@ -20,11 +20,12 @@ if (opendir(OP, "op")) { print "ok 1\n"; } else { print "not ok 1\n"; } @D = grep(/^[^\.].*\.t$/i, readdir(OP)); closedir(OP); -## -## This range will have to adjust as the number of tests expands, -## as it's counting the number of .t files in src/t -## -my ($min, $max) = (150, 170); +open $man, "<../MANIFEST" or die "Can't open ../MANIFEST: $!"; +my $expect; +while (<$man>) { + ++$expect if m!^t/op/[^/]+\t!; +} +my ($min, $max) = ($expect - 10, $expect + 10); if (@D > $min && @D < $max) { print "ok 2\n"; } else { printf "not ok 2 # counting op/*.t, expect $min < %d < $max files\n", |