URI: 
       tImprove test for check/addnew - lumia - Archive checksum manager
  HTML git clone git://lumidify.org/git/lumia.git
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 1c24f92d5ebb13f5c604e709d3822e9834cea4f8
   DIR parent a4d16b3c7af854ea44887d829731d1405cbb66f2
  HTML Author: lumidify <nobody@lumidify.org>
       Date:   Wed, 25 Mar 2020 19:39:33 +0100
       
       Improve test for check/addnew
       
       Diffstat:
         M lumia.pl                            |       6 ++++--
         M tests/addcknew.sh                   |       7 +++++++
         M tests/addcknew.txt                  |      10 ++++++++++
       
       3 files changed, 21 insertions(+), 2 deletions(-)
       ---
   DIR diff --git a/lumia.pl b/lumia.pl
       t@@ -296,7 +296,7 @@ sub write_special_cksums {
        # - if $after_dir_func is set, it is called after processing the
        #   files in each directory that has new files
        sub check_new_files {
       -        my ($dir, $file_func, $before_dir_func, $after_dir_func) = @_;
       +        my ($top_dir, $file_func, $before_dir_func, $after_dir_func) = @_;
                my $iter = make_file_iter sub {1}, sub {
                        my $dir = shift;
                        my $dh;
       t@@ -340,7 +340,7 @@ sub check_new_files {
                                $after_dir_func->($dir);
                        }
                        return \@dirs;
       -        }, $dir;
       +        }, $top_dir;
                # Is this a horrible hack? I dunno, but it sure is sweet...
                while ($iter->()) {}
        }
       t@@ -976,6 +976,8 @@ if ($cmd eq "mv") {
                die "Invalid number of arguments\n" if @ARGV > 1;
                my $dir = @ARGV ? $ARGV[0] : ".";
                update_special $dir;
       +} else {
       +        pod2usage(-exitval => 1, -verbose => 1);
        }
        
        __END__
   DIR diff --git a/tests/addcknew.sh b/tests/addcknew.sh
       t@@ -22,5 +22,12 @@ touch a/fred
        ../../lumia.pl addnew a
        ../../lumia.pl check | sort
        
       +echo
       +# keep checksum files of subdirectories
       +../../lumia.pl clean -q
       +touch a/bob
       +../../lumia.pl addnew a | sort
       +../../lumia.pl checknew | sort
       +
        cd ..
        rm -r tmp
   DIR diff --git a/tests/addcknew.txt b/tests/addcknew.txt
       t@@ -21,3 +21,13 @@ OK ./c/.lumidify_archive_dirs
        OK ./f1
        OK ./f2
        OK ./f3
       +
       +Added "a/bob"
       +Added "a/fred"
       +./-bob
       +./a
       +./b
       +./c
       +./f1
       +./f2
       +./f3