HTF icon indicating copy to clipboard operation
HTF copied to clipboard

Monadic assertion combinators: assertEqualM, ...

Open agrafix opened this issue 8 years ago • 3 comments

A nice set of additional assertion combinators would be something like:

assertEqualM :: (Eq a, Show a) => a -> IO a -> IO () 

agrafix avatar Feb 20 '17 13:02 agrafix

Hey, hspec-expectations provides shouldReturn which has a similar type.

Despite the name, hspec-expectations is not tied to hspec. It only depends on HUnit and works with any testing framework that supports HUnit.

sol avatar Feb 21 '17 00:02 sol

@skogsbaer BTW, do you still use a preprocessor to attach location information to failing test cases?

Recent versions of HUnit provide source locations with failing assertions, and the call-stack package allows you to work with them in a backward compatible manner.

This may be more robust.

sol avatar Feb 21 '17 00:02 sol

@sol with respect to your question regarding location information: see #72

skogsbaer avatar Nov 06 '18 06:11 skogsbaer