- Generates Arbitrary instances for Thrift structs, enums and exceptions
- Provides Arbitrary instances for GHC's Int64, Data.Map.Map and Data.Set.Set
- Makes Thrift enums instances of Bounded and improves the Enum instance declaration
Making a type an instance of Test.QuickCheck.Arbitrary specifies how to generate random instances of the struct. This is useful for testing.
For example, consider the following simple Thrift declaration:
With the patch, the following program (import statements elided) is a fuzzer for the log service.
In implementing the Arbitrary instances, it was useful to make Thrift enums instances of Bounded and to improve the Enum instance. Specifically, whereas before,
would throw an exception, now it behaves as expected without an exception.
I consider the patch incomplete. It's more of a starting point for a discussion at this point than a serious candidate for inclusion. If it is of interest, I'd appreciate some direction on testing it as well as style, and I'd welcome any other comments or thoughts.