elm-explorations / elm-explorations/test

Need exclusive range fuzzers

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

Description

I have a test where I move an item from a custom collection into another (this neccessitates changing IDs, which is why it is a special function). I generate two lists of strings to be converted into my collection and then grab a random index from the first collection to be moved into the second.

To determine the index of the item to move, I use a `percentage` fuzzer. However, the test fails because of the edge case of the percentage being 1, where `floor`ing the `List.length * percent` doesn't help and neccessitates an extra conditional to work around the edge case.

I feel like there might be a more elegant way to choose an index. But I also think that exclusive range fuzzers might be useful in other situations as well, so I thought that this use case might motivate discussion around them.

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.