hedgehogqa / hedgehogqa/fsharp-hedgehog

Bug in `Shrink.list` skips singleton?

Open
#483 5 comments 0 reactions 0 assignees View on GitHub
bug
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.