hspec / hspec-hedgehog

A library to integrate hedgehog tests into your hspec test suite.
https://hackage.haskell.org/package/hspec-hedgehog
Other
28 stars 6 forks source link

Suppress source locations from `src/Test/Hspec/Hedgehog.hs` #25

Closed sol closed 1 year ago

sol commented 1 year ago

What's the problem this is intending to solve?

property has a HasCallStack constraint that we "close" in Test.Hspec.Hedgehog => for a user this stack / location is hardly ever helpful => it is better to suppress it

Note that Hedgehog does not regularly show these unhelpful locations to the user, as evalIO, ==, etc capture their own call stack, which Hedgehog will then use instead. However, if e.g. an exception escapes, then Hedgehog will use them as a fallback. If you want to play around with it, then e.g. add liftIO $ throwIO (ErrorCall "foo") to some property.

sol commented 1 year ago

@parsonsmatt any chance to get this merged sometime soon?

parsonsmatt commented 1 year ago

Sure! Sorry for the delay. Do you mind adding a changelog entry and a version bump so I can release asap?

sol commented 1 year ago

Sure! Sorry for the delay. Do you mind adding a changelog entry and a version bump so I can release asap?

Done as a separate PR (#27) to not unnecessarily cause conflicts.