Check for readdir() directly, rather than more general POSIX test
sort results of glob expansion for better alignment with readdir results
chdir 't' if -d 't';
@INC = '../lib';
require Config; import Config;
- if ($Config{'extensions'} !~ /\bPOSIX\b/) {
+ if (not $Config{'d_readdir'}) {
print "1..0\n";
exit 0;
}
$dot = new DirHandle ".";
print defined($dot) ? "ok" : "not ok", " 1\n";
-@a = <*>;
+@a = sort <*>;
do { $first = $dot->read } while defined($first) && $first =~ /^\./;
print +(grep { $_ eq $first } @a) ? "ok" : "not ok", " 2\n";