Skip to content

How exactly to rerun failed examples? #281

@Fryie

Description

@Fryie

Hi, I'm trying to figure out how exactly to reproduce a failure in my test so I can debug it. I receive output like "Replay with 1006624065 8850 and size 2". But I'm not exactly sure how I can generate the exact example that caused the failure.

I'm trying

let args = CheckerArguments(replay: (StdGen(1006624065, 8850), 2))
property("something", arguments: args) <- forAll ...

but it looks like that generates 100 test cases. How can I get only exactly the one that failed?

As a workaround I guess I can assign my condition in the forAll closure to a variable and work with if ... else, but maybe there's an easier way.

(Also, it would be nice if the output could be something like

Replay with "arguments: CheckerArguments(replay: (StdGen(1006624065, 8850), 2))"

or something, because currently it's not really intuitively clear where these values need to be inserted.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions