0

I have a test using FsCheck, when it fails it give me the information about the seed to put on the Replay property to reproduce the failed test. But to debug this is really hard, because it will not fail on the first value.

FsCheck also give me the information about the number of attempt until fail: Falsifiable, after 74 tests

Is there any way to run the exactly value that has failed?

Workarounds that I'm using:

  • Create test passing the value that it gives me to debug, and after fix the code I delete this test;
  • Add a conditional breakpoint in the test for the value that make the test fails.

Both of them work, but must be a better way.

thur
  • 964
  • 1
  • 15
  • 27
  • 1
    That's not supported at the moment, though it's true FsCheck has all the information to print the seed for the failing test as well. There is a slight concern that jumping to that doesn't produce the exact same values, if side-effects are involved, but not so much I'd be worried about it. I do recommend and use your first solution, but I don't delete the test - after all, this is a bug I wrote before so I'm likely to make it again. Over time, my tests become a regression suite of sorts. – Kurt Schelfthout Jun 07 '21 at 16:55
  • Thanks for the comment @KurtSchelfthout. I think that this could be the answer since is not supported at the moment. Also I really liked your point of view related to those cases be your regression suite. – thur Jun 10 '21 at 12:10

0 Answers0