From bd79768bac0e5d9b0578cb07aa2d9fa9bc4ddb8b Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sun, 8 May 2016 11:47:54 +0200 Subject: GHC 7.8 compatibility --- src/Codec/Pesto/Parse.lhs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Codec/Pesto/Parse.lhs') diff --git a/src/Codec/Pesto/Parse.lhs b/src/Codec/Pesto/Parse.lhs index 1777aa2..5e6d23c 100644 --- a/src/Codec/Pesto/Parse.lhs +++ b/src/Codec/Pesto/Parse.lhs @@ -345,7 +345,14 @@ Test helpers: > isLeft (Left _) = True > isLeft _ = False +A generic parser error: + > parseError = Left (newErrorUnknown (newPos "" 0 0)) + +Compare output of parser ``f`` for string ``str`` with ``expected``. The +expected result can be a parser error, which matches any actual parse error +(first case). + > cmpParser f str (Left _) = TestCase $ assertBool str $ isLeft $ runParser (f <* eof) () "" str > cmpParser f str expected = str ~: runParser (f <* eof) () "" str ~?= expected -- cgit v1.2.3