Zach, did you find an answer for this in the end?

On Sun, 28 Aug 2016 at 11:52 Zachary Kessin <zkes...@gmail.com> wrote:

> I am banging my head against the elm-test fuzzer API.
>
> I have a record like this
>
>
> type alias Location =
>     { id : String
>     , latitude : Float
>     , longitude : Float
>     , name : String
>     }
>
> That I wish to create a fuzzer for, my first thought was to do something
> like this
>
>
>
> locationFuzzer : Fuzzer Location
> locationFuzzer =
>      Fuzz.custom
>         (Random.map4 Location string.generator
>              (Random.float -90 90)
>              (Random.float -180 180)
>               string.generator)
>         (\{id, latitude,longitude , name }
>             -> Shrink.map Location
>                (Shrink.string id)
>                `Shrink.andMap`(Shrink.float latitude)
>
>                `Shrink.andMap` (Shrink.float longitude)
>                `Shrink.andMap` (Shrink.string name)
>                    )
>
> But that is not right, is there a good way to create custom fuzzers for
> complex data, it really should be pretty easy I would think
>
> Zach
>
> --
> Zach Kessin
> SquareTarget <http://squaretarget.rocks?utm_source=email-sig>
> Twitter: @zkessin <https://twitter.com/zkessin>
> Skype: zachkessin
> ᐧ
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to