diff --git a/haskell/Pre.hs b/haskell/Pre.hs index fc4bdc9..84ab04f 100644 --- a/haskell/Pre.hs +++ b/haskell/Pre.hs @@ -107,6 +107,7 @@ import Control.Monad.Writer import Data.Bifunctor import Data.Bool import Data.Char +import Data.Either.Extra import Data.Finite import Data.Fixed (Fixed (MkFixed)) import Data.Foldable hiding (foldl1, foldr1, maximum, maximumBy, minimum, minimumBy) @@ -433,8 +434,10 @@ runTests opts r0 (TestTree name tc ts) = pure $ Left e Right (Left e) -> pure $ Left $ ExceptionFailure e - Right (Right (r, dt)) -> - Right . (dt,) <$> for ts (runTests opts r) + Right (Right (r, dt)) -> do + rs <- for ts $ runTests opts r + let childTimes = fromMaybe 0 $ eitherToMaybe $ fmap (sum . map fst) $ traverse (.result) rs + pure $ Right (dt + childTimes, rs) where runTest = \case TestCase f -> timed (liftIO . evaluate . DeepSeq.force) $ f r0