You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Curious what people's thoughts are on making tasty-hunit functions work on any MonadIO. It's not uncommon for me to write hunit tests with assertions interspersed through my monadic code, e.g.
It would be a minor improvement to be able to do simply
testCase "Check database operations"$
runMyMonad $do
x <- doThing1
x @?=100
x2 <- doThing2
x2 @?="hello world"
I'm willing to open a PR; the only downside I can see is making the Haddock docs a bit less straightforward (instead of returning a simple Assertion, it would now return MonadIO m => m ()).
The text was updated successfully, but these errors were encountered:
My main concern would be mainly introducing ambiguous types, esp. if it breaks existing code. It should be fine with the "standard" usage of testCase "name" $ 2 @?= 2 because testCase forces the m to IO, and also with lifting it using liftIO as in your own example. So I guess the risk is not that high.
Curious what people's thoughts are on making
tasty-hunit
functions work on anyMonadIO
. It's not uncommon for me to write hunit tests with assertions interspersed through my monadic code, e.g.It would be a minor improvement to be able to do simply
I'm willing to open a PR; the only downside I can see is making the Haddock docs a bit less straightforward (instead of returning a simple
Assertion
, it would now returnMonadIO m => m ()
).The text was updated successfully, but these errors were encountered: