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
Use Guava's testlib for increased test coverage #1196
Comments
Whoa, just happened to see this 15 hours later. Note that these suites are extremely picky. But as you can see, you can turn things off by feature, and you can also suppress individual tests. Some of the picky stuff doesn't matter much in absolute terms, but it makes migrating to your collections from others a more "guaranteed safe" operation. It would be nice if we could rewrite it using modern JUnit instead of hacking the suites together the way we do. It would just be a project. |
Thank you for sharing this @ben-manes! I was not aware of this project until I saw this issue. Definitely agree with @kevinb9n comment on helping make migrations "guaranteed safe" operations. Thank you both for the comments and pointers! |
@kevinb9n that reddit thread reminded me to go take a peek at EC, and I am now porting EC's mutable map unit tests into Caffeine as another sanity check. On quite a few projects I have run the Guava's tests out of curiosity and found small bugs (spring, expiringmap, cache2k, primitive collections, fastutil, coherence), so it is very nice but unknown gem. Caffeine has its own map tests, but like others is not designed for reuse. Those use parameterized testing to run against every cache configuration the matches the specification constraints. I know in TestNG you can use an |
@ben-manes We have a custom ConcurrentHashMap (and an unsafe version of same). We also have MultiReader collections for List, Set, Bag. Thank you for the link, I will check it out! |
…fiedMap.EntrySet Signed-off-by: Rustam Mehmandarov <mehmandarov@gmail.com>
…ioned in eclipse#1196. Also optimize some implementations of toString() that were delegating to iterators. Signed-off-by: Craig P. Motlin <cmotlin@gmail.com>
…ioned in eclipse#1196. Also optimize some implementations of toString() that were delegating to iterators. Signed-off-by: Craig P. Motlin <cmotlin@gmail.com>
…ioned in eclipse#1196. Also optimize some implementations of toString() that were delegating to iterators. Signed-off-by: Craig P. Motlin <cmotlin@gmail.com>
…ioned in eclipse#1196. Also optimize some implementations of toString() that were delegating to iterators. Signed-off-by: Craig P. Motlin <cmotlin@gmail.com>
…ioned in eclipse#1196. Also optimize some implementations of toString() that were delegating to iterators. Signed-off-by: Craig P. Motlin <cmotlin@gmail.com>
…ioned in eclipse#1196. Also optimize some implementations of toString() that were delegating to iterators. Signed-off-by: Craig P. Motlin <cmotlin@gmail.com>
Implement missing implementations of toString(), fixing an issue mentioned in #1196. Also optimize some implementations of toString() that were delegating to iterators.
o/ Just found this one (Author of Primitive Collections) But if you want to get some inspirations on how to get to that level too feel free to look. (Note that this is like a custom template library that I have written myself that basically can do very basic "if" statements & "ignore" areas where certain lines can be ignored from the templater) Small note: don't try to run the unit tests, these take an hour on average to complete.... |
Guava provides a convenient testlib for their collection tests. This can be used for other collection implementations, making a handy second set of tests to catch oversights. For example it found a few small bugs in FastUtil. In the test case below the
Map.entrySet().toString()
is missing, so it does not pretty-print the contents (this can be ignored usingsuppressing(Method)
).Maps.mutable tests
The text was updated successfully, but these errors were encountered: