-
Notifications
You must be signed in to change notification settings - Fork 24
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
WIP:Report found files & folders while scanning #39
Conversation
Current coverage is 100% (diff: 100%)@@ master #39 diff @@
===================================
Files 7 7
Lines 221 224 +3
Methods 0 0
Messages 0 0
Branches 0 0
===================================
+ Hits 221 224 +3
Misses 0 0
Partials 0 0
|
if !reflect.DeepEqual(*result, File{}) { | ||
t.Error("GetSubTree didn't return emtpy file on ReadDir failure") | ||
} | ||
} | ||
|
||
func dummyProgressConsumer(progress <-chan int) { | ||
for range progress { |
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.
you are actually not testing that the functionality you implemented works
}() | ||
go func() { | ||
for range ticker.C { | ||
log.Printf("Scanning.. Already found %d objects\n", objs) |
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.
objects? Would "files" describe better what we found?
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.
Would you consider 'folders' to also be 'files'?
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.
That's a good point. We are now using folder/tree/file, often interchangeably. I think we should come up with naming convention going forward. I was thinking about calling everything file
, but that might be more confusing. Maybe we can say that folder
is a special case of file
and stop using tree
completely? What's your opinion?
@@ -78,7 +78,9 @@ func TestGetSubTreeOnSimpleDir(t *testing.T) { | |||
}}, | |||
}} | |||
ignoredFolders := map[string]struct{}{"g": struct{}{}} | |||
result := GetSubTree("b", nil, createReadDir(testStructure), ignoredFolders) | |||
progress := make(chan int, 0) |
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.
the 0 here is default (channel not buffered), we might omit that
Superseeded by #60. |
Todo:
This is the basis for #14