M: Extended unit test.

This commit is contained in:
Jens Luedicke
2012-09-01 10:28:53 +02:00
parent 7d487f05c5
commit 8ea37c6a8c

16
t/1.t
View File

@@ -13,6 +13,18 @@ ok( ref($dw) eq 'File::DirWalk' );
dies_ok { $dw->setHandler(Foo => 0); }
$dw->onFile(sub {
my ($path) = @_;
if (basename($path) eq "1.t") {
return ABORTED;
}
return SUCCESS;
});
ok( $dw->walk($0) == ABORTED );
$dw->onDirEnter(sub {
my ($path) = @_;
@@ -62,11 +74,11 @@ ok( $dw->walk($perl_path) == ABORTED );
$dw->onFile(sub {
my ($path) = @_;
if (basename($path) eq "1.t") {
if (basename($path) eq "sh") {
return ABORTED;
}
return SUCCESS;
});
ok( $dw->walk($0) == ABORTED );
ok( $dw->walk("/bin") == ABORTED );