should avoid duplicating the function code in the test; it's not much of a test that way. Better to set up a test directory you know the structure of, and then assert against the files within it explicitly rather than duplicating the recursion code. 

e.g. if you know the test directory has a file `foo/bar/baz`, just check that `$destdir/foo/bar/baz` has a modified hash -- no need to recurse down.