Add test for #6.
[packages/parsec.git] / test / Util.hs
1
2 module Util where
3
4 import Text.Parsec
5 import Text.Parsec.String ( Parser )
6
7 -- | Returns the error messages associated
8 -- with a failed parse.
9 parseErrors :: Parser a -> String -> [String]
10 parseErrors p input =
11 case parse p "" input of
12 Left err ->
13 drop 1 $ lines $ show err
14 Right{} -> []