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 );
|
ok( $dw->walk($perl_path) == ABORTED );
|
||||||
|
|
||||||
|
$dw = new File::DirWalk();
|
||||||
$dw->onFile(sub {
|
$dw->onFile(sub {
|
||||||
my ($path) = @_;
|
my ($path) = @_;
|
||||||
|
|
||||||
if (basename($path) eq $perl_interpreter) {
|
if ($dw->currentBasename() eq $perl_interpreter) {
|
||||||
return ABORTED;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
});
|
});
|
||||||
|
|
||||||
ok( $dw->walk($perl_path) == ABORTED );
|
ok( $dw->walk($perl_path) == 42 );
|
||||||
|
|
||||||
$dw->onFile(sub {
|
|
||||||
my ($path) = @_;
|
|
||||||
|
|
||||||
if (basename($path) eq "sh") {
|
|
||||||
return ABORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
return SUCCESS;
|
|
||||||
});
|
|
||||||
|
|
||||||
ok( $dw->walk("/bin") == ABORTED );
|
|
||||||
|
|||||||
Reference in New Issue
Block a user