6 require Config; import Config;
7 if (not $Config{'d_readdir'}) {
14 use Test::More tests => 5;
16 # Fetching the list of files in two different ways and expecting them
17 # to be the same is a race condition when tests are running in parallel.
18 # So go somewhere quieter.
20 if ($ENV{PERL_CORE} && -d 'uni') {
22 push @INC, '../../lib';
26 $dot = DirHandle->new('.');
31 do { $first = $dot->read } while defined($first) && $first =~ /^\./;
32 ok(+(grep { $_ eq $first } @a));
34 @b = sort($first, (grep {/^[^.]/} $dot->read));
35 ok(+(join("\0", @a) eq join("\0", @b)));
38 @c = sort grep {/^[^.]/} $dot->read;
39 cmp_ok(join("\0", @b), 'eq', join("\0", @c));
43 is(defined $dot->read, '');