Hedgehog sampling - Haskell

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Asad Saeeduddin

Is there a way to see some sample values for a hedgehog test that passes? I can't shake the feeling that my tests are passing because they test nothing

Fintan Halpenny

There's a sample function I think

Asad Saeeduddin

@Fintan Halpenny thanks. i was hoping for something like MonadIO m => Property -> m () instead, the properties are kind of a pain to deconstruct and thread the sample into

Matt Peddie

could you just stick H.failure at the end of your Property and see what generated value it reports?

Lysxia

Hedgehog (like QC) has combinators to collect custom statistics about your test cases https://hackage.haskell.org/package/hedgehog-1.0.2/docs/Hedgehog.html#g:4

Matt Peddie

@Asad Saeeduddin I wonder whether you could also use https://hackage.haskell.org/package/hedgehog-1.0.2/docs/Hedgehog.html#v:withConfidence to make sure you're testing what you think you're testing?

Asad Saeeduddin

@Matt Peddie That's interesting. What should I be passing for Confidence?

Matt Peddie

the Confidence type is given a few lines above withConfidence