Change 32930 by [EMAIL PROTECTED] on 2008/01/09 22:36:21

        grep the MANIFEST to avoid having hard coded numbers in readdir.t

Affected files ...

... //depot/perl/t/op/readdir.t#21 edit

Differences ...

==== //depot/perl/t/op/readdir.t#21 (xtext) ====
Index: perl/t/op/readdir.t
--- perl/t/op/readdir.t#20~31341~       2007-06-06 07:42:01.000000000 -0700
+++ perl/t/op/readdir.t 2008-01-09 14:36:21.000000000 -0800
@@ -20,11 +20,12 @@
 @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",
End of Patch.

Reply via email to