Supposedly a Property test library

Supposing that my code works...

Over the past few weeks, I’ve been inspired to create a new property testing library for rust, very much inspired by the work in hypothesis.

Why use suppositions over say, quickcheck? For one, this takes inspiration from hypothesis and theft. While it’s still in it’s early days, the generator system (inspired by hypothesis’ generators means that you don’t need a seperate shrinking mechanism for each datatype.

To give an example, I ported my previous die-hard puzzle to this library, and while it’s fairly similar, there are a few changes:

The main changes are that we don’t need a custom Arbitrary instance for the Op type, as we can build it using combinators, and that the test is expressed as a rust closure, rather than requiring a free function.

In terms of what’s implemented, we have generators for most of rust’s primitive types, combinators for same, and a fair few examples. It’s far from complete though, so what’s offered is more in the spirit of a technical preview to interested parties than a full fledged release. Feel free to have a look at suppositions on crates.io and poke about the suppositions repository. But I’d welcome input on the design and implementation.