X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FAssertions.hs;h=f6152d74cb0c867b96aaf708640b5190109b7d6d;hb=a499efdb0e215ac424fe7c38a52430daebefc22b;hp=023cf6503adc11b8bf7d6b26d3aad6193c4b1612;hpb=dce4b1749ef651ecd19ad69d9eaccb9807d8c631;p=spline3.git diff --git a/src/Assertions.hs b/src/Assertions.hs index 023cf65..f6152d7 100644 --- a/src/Assertions.hs +++ b/src/Assertions.hs @@ -8,7 +8,7 @@ module Assertions ( where import Control.Monad ( unless ) -import Test.HUnit ( +import Test.Tasty.HUnit ( Assertion, assertBool, assertFailure ) @@ -17,8 +17,12 @@ import Comparisons ( (~=) ) -- | 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") ++ @@ -27,5 +31,6 @@ assertAlmostEqual preface expected actual = -- | It's asinine that this doesn't exist already. +-- assertTrue :: String -> Bool -> Assertion assertTrue = assertBool