2 module Main (main) where
7 main = do xs <- readFile "testlog"
10 unexpectedTests = filter (any ("unexpected" `isInfixOf`)) tests
11 putStr $ unlines $ concat unexpectedTests
13 breakTests :: [String] -> [[String]]
14 breakTests xs = splitStarting ("=====> " `isPrefixOf`)
15 -- Ignore lines telling us that we're running a .T file:
16 $ filter (not . ("====> Running " `isPrefixOf`)) xs
18 splitStarting :: (a -> Bool) -> [a] -> [[a]]
19 splitStarting f xs0 = case break f xs0 of
20 (_, intro : xs) -> ss intro xs
22 where ss intro xs = case break f xs of
23 (this, intro' : rest) ->
24 (intro : this) : ss intro' rest
25 (this, []) -> [intro : this]