hedgehogqa / haskell-hedgehog-classes

Hedgehog will eat your typeclass bugs
BSD 3-Clause "New" or "Revised" License
56 stars 17 forks source link

No easy way to change number of tests #21

Open kanwren opened 5 years ago

kanwren commented 5 years ago

Currently, there's not an easy way to change the number of tests run from the default (100). Even if you do reach in and change it manually, it doesn't change the successful test output, which as far as I know is hardcoded to "✓ passed 100 tests."

It would be nice to change the number of tests for tests where a potential failure case might be particularly rare.

chessai commented 5 years ago

i'm not sure what the best way of doing this would be.

chessai commented 5 years ago

i may need to implement some monad transformer on top of PropertyT IO that adds ReaderT PropertyConfig. Then variants of each of the lawsCheck functions that take in a PropertyConfig could be added. this would require a bunch of internal work, but would minimise external impact.

chessai commented 5 years ago

this will actually be easier if you are using tasty-hedgehog. related to #13

carlwr commented 3 months ago

Old issue, just mentioning in case it is of help to anyone encountering this issue:

"Reaching in" and "manually" changing a property stored in a Laws does actually change the property, including the number of tests that will be run if that is targeted - however, the output will still print that 100 tests were run since that print-out is hard-coded:

https://github.com/hedgehogqa/haskell-hedgehog-classes/blob/c97c4aa97095904caeed826a4962e2a87f00b3f3/src/Hedgehog/Classes/Common/Laws.hs#L219

https://github.com/hedgehogqa/haskell-hedgehog-classes/blob/c97c4aa97095904caeed826a4962e2a87f00b3f3/src/Hedgehog/Classes/Common/Laws.hs#L238