I am trying to perform the following behavior with FsCheck: I would like to create a generator that will generate an instance of type MyUnion , with each string field not equal to null / empty.
type MyNestedUnion = | X of string | Y of int * string type MyUnion = | A of int * int * string * string | B of MyNestedUnion
My "real" type is much larger / deeper than MyUnion , and FsCheck is able to generate an instance without any problems, but the string fields in cases of merging are sometimes empty. (For example, it can generate B (Y (123, "")) )
Perhaps there is some obvious way to combine FsCheck NonEmptyString and its support to generate arbitrary connection types that I am missing?
Any tips / pointers in the right direction are greatly appreciated.
Thanks!
f # testing fscheck
Edward dewhurst
source share