M: Improved and extended unit tests.

This commit is contained in:
Jens Luedicke
2013-03-09 13:59:54 +01:00
parent 42b1a13c62
commit ada7ad784b
55 changed files with 184 additions and 67 deletions

29
t/2.t Normal file
View File

@@ -0,0 +1,29 @@
use Test::More qw(no_plan);
use Test::Exception;
use File::Basename;
BEGIN { use_ok( 'File::DirWalk' ); }
require_ok( 'File::DirWalk' );
ok(-e "t/");
ok(-d "t/");
foreach my $f qw(1.t 2.t 3.t 4.t) {
$dw = new File::DirWalk();
$dw->setDepth(1);
$dw->onFile(sub {
my ($path) = @_;
ok(-e $path);
ok(-f $path);
if ($dw->currentBasename() eq $f) {
return 42;
}
return SUCCESS;
});
is($dw->walk("t/"), 42);
}