6 require Config; import Config;
7 if (not $Config{'d_readdir'}) {
18 # Fetching the list of files in two different ways and expecting them
19 # to be the same is a race condition when tests are running in parallel.
20 # So go somewhere quieter.
22 if ($ENV{PERL_CORE} && -d 'uni') {
27 $dot = new DirHandle ($^O eq 'MacOS' ? ':' : '.');
32 do { $first = $dot->read } while defined($first) && $first =~ /^\./;
33 ok(+(grep { $_ eq $first } @a));
35 @b = sort($first, (grep {/^[^.]/} $dot->read));
36 ok(+(join("\0", @a) eq join("\0", @b)));
39 @c = sort grep {/^[^.]/} $dot->read;
40 cmp_ok(+(join("\0", @b), 'eq', join("\0", @c)));
44 ok(!defined($dot->read));