elm-explorations / test

Write unit and fuzz tests for Elm code.
https://package.elm-lang.org/packages/elm-explorations/test/latest
BSD 3-Clause "New" or "Revised" License
236 stars 40 forks source link

Shrinking optimization: check what part of RandomRun did a generator use #232

Open Janiczek opened 7 months ago

Janiczek commented 7 months ago

This idea is courtesy of @CoderDennis - thanks!

When a shrunk RandomRun is tried, and succeeds in generating a test-failing value, remove the unused suffix of the RandomRun value (it would have to be cleaned up with further ShrinkCmds later otherwise). Return only the used part of the RandomRun as the new best shrink.