lfs/batcher: introduce test cases#613
Merged
technoweenie merged 3 commits intogit-lfs:masterfrom Aug 27, 2015
Merged
Conversation
This commit adds the notion of a test case into the `lfs.Batcher` tests. Each test case has three properties: - the batch size - the number of batched items - whether or not the batcher should exit This commit also adds a helper func called `assertAll` which processes a set of test cases, throwing assertion errors into the `*testing.T` along the way. On the other hand, this commit does not contain any utilities to assert that a deadlock will occur when feeding items into a Batcher, i.e., when the batch size is set to 0.
834d719 to
4a41bf1
Compare
lfs/batcher_test.go
Outdated
Contributor
There was a problem hiding this comment.
Go comments for types and funcs start with the name. The only godoc comments that have a prefix are package comments. https://golang.org/doc/effective_go.html#commentary
Contributor
Author
|
Thanks for the suggestions, @technoweenie. I've pushed commits to address both of your comments. |
Contributor
|
Thanks for the tests! |
technoweenie
added a commit
that referenced
this pull request
Aug 27, 2015
lfs/batcher: introduce test cases
Contributor
Author
There was a problem hiding this comment.
Thanks for fixing that! Totally missed it.
Contributor
Author
|
Thanks for the review @technoweenie, @WillHipschman! |
This file contains hidden or 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
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.
This commit adds the notion of a test case into the
lfs.Batchertests. Eachtest case has three parameters: a batch size, the number of items to add to that
batcher, and whether or not it should exit the batcher after adding all items.
This commit also adds a helper func called
assertAllwhich processes a set oftest cases, throwing assertion errors into the
*testing.Talong the way.On the other hand, this commit does not contain any utilities to assert that a
deadlock will occur when feeding items into a Batcher, i.e., when the batch size
is set to 0.