From 5b88804b955604d0af8805842b17d516bd9f3bd4 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Thu, 1 Jul 2010 10:32:03 +0100 Subject: [PATCH] Convert DirHandle's tests to Test::More. Remove a vestigial reference to MacOS. --- lib/DirHandle.t | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/DirHandle.t b/lib/DirHandle.t index 35a7ea8..f3a9304 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 ".."; -- 2.7.4