hablo/test/Utils.hs

18 lines
379 B
Haskell
Raw Normal View History

{-# LANGUAGE NamedFieldPuns #-}
2023-08-20 22:24:58 +02:00
module Utils
( labeled
, testDataPath
, testGroup ) where
import System.FilePath ((</>))
2023-08-20 22:24:58 +02:00
import Test.HUnit (Test(..))
testDataPath :: FilePath -> FilePath
testDataPath = ("test" </>)
2023-08-20 22:24:58 +02:00
testGroup :: String -> [Test] -> Test
testGroup name = TestLabel name . TestList
labeled :: [(String, Test)] -> [Test]
labeled = fmap (uncurry TestLabel)