tasty
tasty copied to clipboard
Simple TestReporter ingredient makes the testsuite hang
The following code runs forever even if it should not according to the documentation since the tasty runs the tests in case of TestReporter
.
It just wants to print resultDescription of every test.
main :: IO ()
main = do
defaultMainWithIngredients [myReporter] $
testGroup
"my suite"
[ testCase "" $ assertBool "" True
]
myReporter :: Ingredient
myReporter = TestReporter [] $
\opts tree -> Just $ \smap -> do
return $ \time -> do
foldM (\acc a -> fmap (acc &&) (getResultFromTVar a >>= processResult)) True smap
processResult :: Result -> IO Bool
processResult res = putStrLn (resultDescription res) >> pure True
getResultFromTVar :: TVar Status -> IO Result
getResultFromTVar var =
atomically $ do
status <- readTVar var
case status of
Done r -> return r
_ -> retry
The Done
case never happens in the getResultFromTVar
and only the retry case is happening.