armor icon indicating copy to clipboard operation
armor copied to clipboard

QuickCheck/Hedgehog integration?

Open axman6 opened this issue 7 years ago • 3 comments
trafficstars

It feels like the randomised generation of data that QuickCheck and Hedgehog offer are a good match for something like arbor - having something of type

testHedgehog :: Armored a => ArmorConfig -> String -> Gen a -> Test

feels pretty natural. Mainly wanted to open the issue to start the discussion because the library currently feels like it's half missing, but I'm not sure what the other half is! :)

axman6 avatar May 06 '18 08:05 axman6

Yeah, when I wrote the fake package I also had a similar feeling that it complimented armor very nicely. I wanted armor to be agnostic to your choice of test framework though. This is why it only depends on HUnit, which provides low level unit test infrastructure used by many of the test frameworks.

mightybyte avatar May 06 '18 15:05 mightybyte

I'm also very interested in your fake package, I'm considering using it to produce reasonable Gen values for Hedgehog 😄 (Also considering adding some Australian instances of things like addresses and phone numbers).

Do you have any thoughts how a package linking Armor and QuickCheck or Hedgehog would look? It feels like you would need to specify a static random seed (as well as how many examples you want to exist).

axman6 avatar May 07 '18 09:05 axman6

Nothing concrete. I tried to make them both as self-contained and composable as I could. The testArmorMany function was created specifically to facilitate this kind of interoperability. I'm definitely willing to add more general helpers like that.

mightybyte avatar May 07 '18 12:05 mightybyte