proptest-rs / proptest

Hypothesis-like property testing for Rust
Apache License 2.0
1.69k stars 158 forks source link

Equivalent of `hypothesis.example`? #330

Closed matthiasgoergens closed 1 year ago

matthiasgoergens commented 1 year ago

It's sometimes useful to add specific examples to test in addition to your generators.

Python's Hypothesis has hypothesis.example for that. What's our equivalent, if any?

If we don't have an equivalent, I can help add it, if you can give me some pointers for getting started. Thanks!

matthew-russo commented 1 year ago

We don't currently have an equivalent but its requested in #284 and I've done a little bit of work towards in. I'm hoping to build on top of the proc macro attribute that's currently being worked on.

The goal is to make it an open API that could potentially be used for clean integrations with similar crates such as rstest if someone doesn't want to use the built-in support. Unfortunately i don't have clear timelines on when we'd expect to get this in.

If its fine with you, I'll go ahead and close this issue and you can track progress on #284