Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@squaremo
Copy link
Member

There were a couple of problems with the implementation:

  • the pre hook was called before yielding a directory. This isn't
    wrong so much as inconvenient -- you can't indent on pre-, and
    outdent on post-, for example.

  • the post hook was called at the top of the stack, i.e., when
    leaving the starting point, so everything had some variety of
    off-by-one problem.

This commits makes the tests a bit more rigorous (the post-hook test
in particular didn't check that the number of times leaving a
directory was equal to the number of times entering a
directory!). I've also given the walk procedure some typedocs, so it
has a better explanation in the API reference.

There were a couple of problems with the implementation:

 - the pre hook was called before yielding a directory. This isn't
   wrong so much as inconvenient -- you can't indent on pre-, and
   outdent on post-, for example.

 - the post hook was called at the top of the stack, i.e., when
   leaving the starting point, so everything had some variety of
   off-by-one problem.

This commits makes the tests a bit more rigorous (the post-hook test
in particular didn't check that the number of times leaving a
directory was equal to the number of times entering a
directory!). I've also given the walk procedure some typedocs, so it
has a better explanation in the API reference.
@squaremo squaremo merged commit 8bd11fd into master Feb 29, 2020
@squaremo squaremo deleted the walk-yield-dir-before-pre branch February 29, 2020 17:13
@squaremo squaremo added this to the 0.4.0 milestone Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants