elm-community / elm-test

moved to elm-explorations/test
https://github.com/elm-explorations/test
BSD 3-Clause "New" or "Revised" License
339 stars 35 forks source link

Add Fuzz.set, Fuzz.dict #188

Open avh4 opened 7 years ago

avh4 commented 7 years ago

Proposing we add

Fuzz.set : Fuzzer a -> Fuzzer (Set a)
Fuzz.dict : Fuzzer comparable -> Fuzzer value -> Fuzzer (Dict comparable value)

You can currently use Fuzz.list a |> Fuzz.map Set.fromList (and similarly for Dict), but shrinking is extremely inefficient when the number of possible values a can produce is small (in my case, each test evaluation takes more than 5 seconds, so evaluating shrinks that are the same as previous shrinks adds up quickly).

Edit: maybe the inefficient shrinking is simply a result of https://github.com/elm-community/elm-test/issues/187 ?

mgold commented 7 years ago

If the only benefit of this is shrinking performance, and we might completely overhaul how shrinking works, let's wait on this one.