This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
More updates to Module-CoreList for Perl 5.20.2
[perl5.git] / lib / DirHandle.t
old mode 100755 (executable)
new mode 100644 (file)
index 35a7ea8..f3a9304
@@ -11,9 +11,7 @@ BEGIN {
 }
 
 use DirHandle;
-require './test.pl';
-
-plan(5);
+use Test::More tests => 5;
 
 # Fetching the list of files in two different ways and expecting them 
 # to be the same is a race condition when tests are running in parallel.
@@ -21,12 +19,13 @@ plan(5);
 my $chdir;
 if ($ENV{PERL_CORE} && -d 'uni') {
   chdir 'uni';
+  push @INC, '../../lib';
   $chdir++;
 };
 
-$dot = new DirHandle ($^O eq 'MacOS' ? ':' : '.');
+$dot = DirHandle->new('.');
 
-ok(defined($dot));
+is(defined $dot, 1);
 
 @a = sort <*>;
 do { $first = $dot->read } while defined($first) && $first =~ /^\./;
@@ -37,11 +36,11 @@ ok(+(join("\0", @a) eq join("\0", @b)));
 
 $dot->rewind;
 @c = sort grep {/^[^.]/} $dot->read;
-cmp_ok(+(join("\0", @b), 'eq', join("\0", @c)));
+cmp_ok(join("\0", @b), 'eq', join("\0", @c));
 
 $dot->close;
 $dot->rewind;
-ok(!defined($dot->read));
+is(defined $dot->read, '');
 
 if ($chdir) {
   chdir "..";