3 ms·
This library does more than "random" testing: when it finds a failure, it will try to reduce the input (called "shrinking") to report a minimal example. Here ar
by mgurlitz 10y ago
This library does more than "random" testing: when it finds a failure, it will try to reduce the input (called "shrinking") to report a minimal example. Here are some similar tools for other languages: http://hypothesis.works/articles/quickcheck-in-every-language/ http://hypothesis.works/articles/quickcheck-in-every-languag...
- zalmoxes 10y agoGo also has a version of this in the stdlib https://golang.org/pkg/testing/quick/ https://golang.org/pkg/testing/quick/
- jlouis 10y agoYes, but the Go tool doesn't do shrinking, which is troublesome once you start building big models. (disclosure: I have some pretty large Erlang QuickCheck models on Github)
- it 10y agoGopter for Go can shrink examples: https://github.com/leanovate/gopter https://github.com/leanovate/gopter.
- jaytaylor 10y agoThis looks amazingly useful. I've been looking for a clojure-esque spec package for Go!
- bjz_ 10y agoAny examples of those you can share? I've been curious about quickcheck for a while now, but have not known how it would work beyond the simple examples that are most often shown.
- burntsushi 10y agoIndeed. Beware of tools claiming to be "quickcheck for language X." Without shrinking, you've lost an invaluable part of what makes quickcheck so useful.