BurntSushi / quickcheck

Automated property based testing for Rust (with shrinking).
The Unlicense
2.4k stars 149 forks source link

Implement Wrapping<integer type> for Arbitrary #87

Closed Wilfred closed 4 years ago

Wilfred commented 9 years ago

It would be nice to be able to use quickcheck with (e.g.) Wrapping<u8>. I'm not sure I can fix this in my own code, adding

impl Arbitrary for Wrapping<u8> {
    fn arbitrary<G: Gen>(g: &mut G) -> Wrapping<u8> {
        Wrapping(Arbitrary::arbitrary(g))
    }
}

generates a compile error because neither Arbitrary nor Wrapping were defined by me.

BurntSushi commented 4 years ago

Looks like an Arbitrary impl was added for Wrapping.