-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make FileCataloger mockable #20
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
harder than it needs to be. There's no (good) way to get a DirEntry from a Path, so all PathBuf duplicate elements need to be replaced with a File implementer
This reverts commit 0f7df61. This is the elegant/fast solution but I don't think it'll work because the DirWalker emits Paths and it would be awkward to change that. Instead we're just going to add a method to vfs to look up a DirWalker by path and hack it to work
This reverts commit 5b508e9.
This reverts commit 467e793.
for more accurate testing
in this case a Duplicates bucket can contain identical files, not just links (unlike a FKBP). This negligibly simplifies / slows down things
add test example
zwimer
approved these changes
Nov 26, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More comments needed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
allows unit tests (see last unit test in tests.rs for an example). I can write most of them if people are too busy to figure it out. (sorry for the delay, it ended up being a lot more nuanced than I expected).
fixes #13
also uses only a
HashMap<Hash, Duplicates>
for the thunk type of HashProxy (doesn't map ID to duplicates). So that means there's no distinction between a hard link and a duplicate file, right? So there's no difference in the output of FileCataloger between 2 links to the same file and 2 identical files? We talked about this way too much so presumably we agreed that was okay. fixes #12