where
import Control.Monad ( unless )
-import Test.HUnit (
+import Test.Tasty.HUnit (
Assertion,
assertBool,
assertFailure )
-- | An HUnit assertion that wraps the almost_equals function. Stolen
--- from the definition of 'assertEqual' in Test\/HUnit\/Base.hs.
-assertAlmostEqual :: String -> Double -> Double -> Assertion
+-- from the definition of 'assertEqual' in Test\/Tasty\/HUnit\/Orig.hs.
+--
+assertAlmostEqual :: String -- ^ The message prefix
+ -> Double -- ^ The expected value
+ -> Double -- ^ The actual value
+ -> Assertion
assertAlmostEqual preface expected actual =
unless (actual ~= expected) (assertFailure msg)
where msg = (if null preface then "" else preface ++ "\n") ++
-- | It's asinine that this doesn't exist already.
+--
assertTrue :: String -> Bool -> Assertion
assertTrue = assertBool