NorfairKing / sydtest

A modern testing framework for Haskell with good defaults and advanced testing features.
113 stars 25 forks source link

Tasty supports "Monadic test definition" #45

Closed dpwiz closed 2 years ago

dpwiz commented 2 years ago

main :: IO ()
main = do
  testTree <- collectTests "before running"
  defaultMain $ testTree "Combine with static"
    [ testTree
    , testCase "this works" $ 'a' @?= 'a'
    ]

collectTests :: String -> IO TestTree
collectTests label = do
  cases <- readFile "dynamic.txt"
  pure $ askOption \(Verbose v) ->
    testGroup label $ interpret v cases
NorfairKing commented 2 years ago

Jup, I guess this is technically true. PR welcome.