elm-explorations / elm-explorations/test

How to make "negative" fuzzers?

Open
#32 17 comments 0 reactions 0 assignees View on GitHub
fuzzers question
Dominant language
Elm
Stars
244
Forks
40
Avg merge
1d 23h
Merged PRs (30d)
2

Description

Hi,

I'm trying to migrate a library on Elm 0.19.0 and my tests were relying on `Fuzz.conditional` to tests cases where an input was "anything but" specific values (ie: I want any integer that is not a multiple of 3 ; I want any string that does not contain some substrings).

I used to do it like this:

```Elm
Fuzz.conditional
{ retries = 10
, fallback = always 1
, condition = \n -> (n |> modBy 3) == 0
}
int
```

Can I do this now? If so, how can I do this now? If not, am I the only one to use that kind of strategy? If so, how do you use fuzzy testing to test those kinds of cases?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.