B: Do not try to walk /bin directory, as this may not work on Non-Unix systems.
This commit is contained in:
19
t/1.t
19
t/1.t
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user