Quickcheck has a macro on Rust stable

I've just released 0.3.0 of quickcheck (no breaking changes other than requiring Rust 1.9), which includes a quickcheck! macro on stable Rust, courtesy of @bluss. See the docs here: http://burntsushi.net/rustdoc/quickcheck/macro.quickcheck!.html

Also, internally, quickcheck now uses panic::catch_unwind instead of spinning up a thread for every test (which was previously the only way to catch a panic on Rust stable).

5 Likes

Nice, thanks for making it happen. I see you chose the simple way. There's a more advanced version in itertools test suite that uses "tt-munching" to support mut and patterns by counting : tokens, but I didn't feel sure about submitting that one to quickcheck, because it might be more fragile or confusing to use.

Yeah, simple is good. Other than that, my main reasons:

  1. I feel like it's pretty rare to bind a parameter with mut in a quickcheck property.
  2. Testable is implemented for much higher arity functions than before, which reduces the need to use tuple patterns.
  3. I haven't really digested the zen of tt munching yet. :slight_smile:

Thanks again for the macro!