-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
The Fuzz module has Fuzz.list and Fuzz.array, but doesn't have Fuzz.set nor Fuzz.dict.
Currently, these are relatively easy to create in user code, but having to do this every time we need such a fuzzer is tedious.
I haven't tried them out but I believe these implementations would work (or be good starting positions if they don't).
set : Fuzz comparable -> Fuzz (Set comparable)
set fuzzer =
list fuzzer
|> map Set.fromList
dict : Fuzz comparable -> Fuzz a -> Fuzz (Dict comparable a)
dict keyFuzzer valueFuzzer =
list (Tuple.pair keyFuzzer valueFuzzer)
|> map Dict.fromListThere is a risk of generating the same keys multiple times which is wasteful, and maybe there are better implementations. In the meantime, I think this would be a valuable addition to the package.
Metadata
Metadata
Assignees
Labels
No labels