From 7b3a6c25702c5b2ca5b746e26ed80df5c251b50e Mon Sep 17 00:00:00 2001 From: Jens Luedicke Date: Sat, 9 Mar 2013 12:25:59 +0100 Subject: [PATCH] B: Do not try to walk /bin directory, as this may not work on Non-Unix systems. --- t/1.t | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/t/1.t b/t/1.t index ab9f61b..6b306c2 100644 --- a/t/1.t +++ b/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 );