-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes rt.cpan.org bug 115511, adds regression test
- Loading branch information
1 parent
9594817
commit da90585
Showing
4 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
use strict; | ||
use warnings; | ||
|
||
# the original intent of this test was to isolate and test solely the | ||
# list_dir method, but it became immediatley apparent that you can't | ||
# very well test list_dir() unless you have a good directory tree first; | ||
# this led to the combining of the make_dir and list_dir testing routines | ||
|
||
use Test::More tests => 2; | ||
use Test::NoWarnings; | ||
|
||
use File::Temp qw( tempdir ); | ||
|
||
use lib './lib'; | ||
use File::Util qw( SL NL OS ); | ||
|
||
# one recognized instantiation setting | ||
my $ftl = File::Util->new( ); | ||
|
||
my $tempdir = tempdir( CLEANUP => 1 ); | ||
my $testbed = $tempdir . SL . $$ . SL . time; | ||
my @test_dirs = qw/ Fin Rey Kylo Poe /; | ||
|
||
for my $tdir ( @test_dirs ) | ||
{ | ||
$ftl->make_dir( $testbed . SL . $tdir ) | ||
} | ||
|
||
is_deeply | ||
( | ||
[ sort $ftl->list_dir( $testbed ) ], | ||
[ sort qw( . .. ), @test_dirs ], | ||
'regression: plain dir listing with only subdirs present (no files)' | ||
); | ||
|
||
exit; |