From 6fecce66bf5da93daf0d8b2ef8093422a24df6a3 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Mon, 4 Feb 2002 23:09:07 +0100 Subject: File::Find tests not cleaning up properly Message-ID: <20020204220907.A8288@rafael> p4raw-id: //depot/perl@14554 --- lib/File/Find/t/find.t | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'lib/File/Find/t/find.t') diff --git a/lib/File/Find/t/find.t b/lib/File/Find/t/find.t index 0a84a0ed6f..c74a646439 100644 --- a/lib/File/Find/t/find.t +++ b/lib/File/Find/t/find.t @@ -64,23 +64,25 @@ my $FastFileTests_OK = 0; sub cleanup { if (-d dir_path('for_find')) { chdir(dir_path('for_find')); - if (-d dir_path('fa')) { - unlink file_path('fa', 'fa_ord'), - file_path('fa', 'fsl'), - file_path('fa', 'faa', 'faa_ord'), - file_path('fa', 'fab', 'fab_ord'), - file_path('fa', 'fab', 'faba', 'faba_ord'), - file_path('fb', 'fb_ord'), - file_path('fb', 'fba', 'fba_ord'); - rmdir dir_path('fa', 'faa'); - rmdir dir_path('fa', 'fab', 'faba'); - rmdir dir_path('fa', 'fab'); - rmdir dir_path('fa'); - rmdir dir_path('fb', 'fba'); - rmdir dir_path('fb'); - } - chdir(File::Spec->updir); - rmdir dir_path('for_find'); + } + if (-d dir_path('fa')) { + unlink file_path('fa', 'fa_ord'), + file_path('fa', 'fsl'), + file_path('fa', 'faa', 'faa_ord'), + file_path('fa', 'fab', 'fab_ord'), + file_path('fa', 'fab', 'faba', 'faba_ord'), + file_path('fb', 'fb_ord'), + file_path('fb', 'fba', 'fba_ord'); + rmdir dir_path('fa', 'faa'); + rmdir dir_path('fa', 'fab', 'faba'); + rmdir dir_path('fa', 'fab'); + rmdir dir_path('fa'); + rmdir dir_path('fb', 'fba'); + rmdir dir_path('fb'); + } + chdir(File::Spec->updir); + if (-d dir_path('for_find')) { + rmdir dir_path('for_find') or print "# Can't rmdir for_find: $!\n"; } } -- cgit v1.2.1