summaryrefslogtreecommitdiff
path: root/lib/DirHandle.t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-07-01 10:32:03 +0100
committerNicholas Clark <nick@ccl4.org>2010-07-01 12:08:50 +0100
commit5b88804b955604d0af8805842b17d516bd9f3bd4 (patch)
tree9e3f6effe94291a53be3bc1ce5a0199184f08c2f /lib/DirHandle.t
parentd460397bbe36e991666185c0884015fdd0a30a6d (diff)
downloadperl-5b88804b955604d0af8805842b17d516bd9f3bd4.tar.gz
Convert DirHandle's tests to Test::More.
Remove a vestigial reference to MacOS.
Diffstat (limited to 'lib/DirHandle.t')
-rw-r--r--lib/DirHandle.t13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/DirHandle.t b/lib/DirHandle.t
index 35a7ea86c3..f3a93044b0 100644
--- a/lib/DirHandle.t
+++ b/lib/DirHandle.t
@@ -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 "..";