purescript-jack icon indicating copy to clipboard operation
purescript-jack copied to clipboard

Properties: Discarding, Aborting

Open damncabbage opened this issue 9 years ago • 5 comments

There are a couple of things that I miss from QuickCheck, but can't figure out how to add without some core changes to Property:

  • ==>: There's no way to Discard a test case; it's either Success or Failure vs [Haskell] QuickCheck's tri-state result.
  • once: There's no equivalent of abort :: Bool; the only cap on the number of times a test is run is all the way back up in check', meaning any change (eg. allowing configuration of the default runner's hardcoded "100 attempts") would be global.

Any thoughts how this should be tackled? My first thought is having Property be more than a newtype, but you might already have an idea as to how you'd tackle this.

damncabbage avatar Nov 16 '16 21:11 damncabbage

(I note that Haskell-Jack piggybacks on the QuickCheck definitions, so following suit with the definition of Property might've been your intent all along.)

damncabbage avatar Nov 16 '16 21:11 damncabbage

I have actually implemented all this in dotnet-jack, so the plan is to port it back in to here.

https://github.com/jystic/dotnet-jack/blob/master/Jack/Property.fs

jacobstanley avatar Nov 17 '16 00:11 jacobstanley

Ha! Oops. Do you want to do it or shall I?

Edit: Umm. This may be a little too extensive for me to tackle, in light of the Property-is-now-a-Monad plan.

damncabbage avatar Nov 17 '16 01:11 damncabbage

Yeah I would rather do it, I'll have a go at it on the weekend if you can wait that long?

jacobstanley avatar Nov 17 '16 02:11 jacobstanley

Thanks. 💦 And please take your time; I didn't mean to give the impression that this was something to rush out.

damncabbage avatar Nov 17 '16 02:11 damncabbage