serde_test: Implement quickcheck Arbitrary on Token (suggestion)
rw opened this issue · 2 comments
rw commented
I want to use quickcheck to test my serde code. My ideal testcase would look like:
- Generate arbitrary serde value
- Serialize the serde value to my data format
- Deserialize a new serde value from my data format
- Check that the old and new serde values are equivalent
It seems to me that implementing the Arbitrary trait from the quickcheck crate would make this simple. Is that a good idea for the serde_test project?
rw commented
A related suggestion is to provide the ability to generate arbitrary JSON.
dtolnay commented
I think both of these would be outside the scope of the serde_test crate, but someone could put together a separate crate focused on testing data formats against arbitrarily generated data structures.