module Test.FileLocation where
import qualified Test.HUnit as HUnit
import Language.Haskell.TH
import FileLocation (locationToString)
import Control.Monad.IO.Class (liftIO)
assertEq :: Q Exp
assertEq = do
loc <- location
let prefix = locationToString loc ++ " "
[|(\x -> HUnit.assertEqual prefix x)|]
assertB :: Q Exp
assertB = do
loc <- location
let prefix = locationToString loc ++ "assertB "
[|(HUnit.assertBool prefix)|]
assertEq' :: Q Exp
assertEq' = do
loc <- location
let prefix = locationToString loc ++ " "
[|(\x -> liftIO . HUnit.assertEqual prefix x)|]
assertB' :: Q Exp
assertB' = do
loc <- location
let prefix = locationToString loc ++ "assertB "
[|(liftIO . HUnit.assertBool prefix)|]