diff options
author | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-03-03 14:11:31 +0100 |
---|---|---|
committer | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-03-03 14:11:31 +0100 |
commit | 5ecef1547e12d76c5a7157f65a90937511600b1b (patch) | |
tree | 6860a9e22a51fca8404e2798c5d04353f85e8d41 | |
parent | 72dbda078045a406732afe9c7fe15e105b50540c (diff) | |
download | sbotools2-5ecef1547e12d76c5a7157f65a90937511600b1b.tar.xz |
sboclean: Change the meaning of the return value for remove_stuff
-rwxr-xr-x | sboclean | 3 | ||||
-rwxr-xr-x | t/01-test.t | 2 |
2 files changed, 3 insertions, 2 deletions
@@ -69,13 +69,14 @@ sub rm_full { sub remove_stuff { exists $_[0] or script_error 'remove_stuff requires an argument.'; - -d $_[0] or say 'Nothing to do.' and return 1; + -d $_[0] or say 'Nothing to do.' and return 0; my $dir = shift; opendir(my $dh, $dir); FIRST: while (my $ls = readdir $dh) { next FIRST if in($ls => qw/ . .. /); rm_full("$dir/$ls"); } + return 1 } sub clean_c32 { diff --git a/t/01-test.t b/t/01-test.t index 84c6edc..fcdfdb3 100755 --- a/t/01-test.t +++ b/t/01-test.t @@ -416,7 +416,7 @@ sub { my $ret; stdout_is (sub { $ret = remove_stuff('/omg/wtf/bbq') }, "Nothing to do.\n", 'output for remove_stuff good'); - is($ret, 1, 'remove_stuff good for invalid input'); + is($ret, 0, 'remove_stuff good for invalid input'); }; # 48: perform_search tests |