Minor improvement to formatting of error messages

Issue #4 new
Matthew Daggitt created an issue

Currently the contents of stderr can be a bit hard to read if it goes over multiple lines as subsequent lines will revert to the previous indentation. Maybe something like the following would be an improvement?

let indent s = unlines $ ("  " <>) <$> lines s in
testFailed $ "Program " ++ intercalate " " (file:args) ++
             " failed with code " ++ show code
             ++ case stderr of
                     Nothing -> ""
                     Just s  -> "\n Stderr was: \n" ++ indent s

Last issue I promise!

Comments (2)

  1. Jan Stolarek repo owner

    I’d need to test this locally before committing to make sure tasty correctly interprets \n, but I’m afraid I might not have the time to do this in the next couple of weeks (same with #3). Remember you can always make your own local copy of the repo with changes and use it as a dependency for your project.

  2. Matthew Daggitt reporter

    Haha no worries. Yup, already made my own copy! Just thought it would be neater if I could contribute the improvements back to the source as well for other people.

  3. Log in to comment