11 | import Control.Monad.Either
20 | runTests : (tests : List Test) -> IO Bool
22 | let longestDesc = foldl (\acc,t => max acc (length t.description)) 0 tests
23 | let padding = \len =>
24 | let diff = longestDesc `minus` len
25 | in pack $
replicate diff ' '
27 | res <- for tests $
\t => do
28 | putStr $
t.description ++ padding (length t.description) ++ " ... "
29 | case !(runEitherT t.run) of
32 | printLn $
colored Red "failed"
36 | printLn $
colored Green "passed"
38 | pure $
all (==True) res