hedgehogqa / hedgehogqa/fsharp-hedgehog
Bug in `Shrink.list` skips singleton?
- Dominant language
- F#
- Stars
- 284
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Description
I was adding reports to some of the challenges in [The Shrinking Challenge](https://github.com/jlink/shrinking-challenge), namely [Length List](https://github.com/jlink/shrinking-challenge/blob/main/challenges/lengthlist.md).
Hedgehog was [not finding the optimal shrink](https://github.com/jlink/shrinking-challenge/blob/main/pbt-libraries/hedgehog-fsharp/challenges/length_list.md), so I took a look at `Shrink.list`.
It appears to skip over the singleton case?
```fsharp
#r "nuget: Hedgehog, 2.0.3"
open Hedgehog
for xs in Shrink.list [1; 2; 3] do
printfn "%A" xs
// []
// [2; 3]
// [1; 3]
// [1; 2]
```
Contributor guide
Research direction
Start by running the reported F# example against Hedgehog 2.0.3 and inspect the Shrink.list entry point. Compare its output with the Length List challenge report; done means the singleton shrink case is handled correctly and the relevant challenge result is no longer suboptimal.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fsharp
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 67/100