B: Do not try to walk /bin directory, as this may not work on Non-Unix systems.

This commit is contained in:
Jens Luedicke
2013-03-09 12:25:59 +01:00
parent 9f8defb0fe
commit 7b3a6c2570

19
t/1.t
View File

@@ -59,26 +59,15 @@ $dw->onBeginWalk(sub {
ok( $dw->walk($perl_path) == ABORTED );
$dw = new File::DirWalk();
$dw->onFile(sub {
my ($path) = @_;
if (basename($path) eq $perl_interpreter) {
return ABORTED;
if ($dw->currentBasename() eq $perl_interpreter) {
return 42;
}
return SUCCESS;
});
ok( $dw->walk($perl_path) == ABORTED );
$dw->onFile(sub {
my ($path) = @_;
if (basename($path) eq "sh") {
return ABORTED;
}
return SUCCESS;
});
ok( $dw->walk("/bin") == ABORTED );
ok( $dw->walk($perl_path) == 42 );