summaryrefslogtreecommitdiff
path: root/src/Codec/Pesto
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2016-05-08 11:47:54 +0200
committerLars-Dominik Braun <lars@6xq.net>2016-05-08 11:47:54 +0200
commitbd79768bac0e5d9b0578cb07aa2d9fa9bc4ddb8b (patch)
tree46352e1b56fa2aedf27890dce4f7d4e44ddc82e8 /src/Codec/Pesto
parent4d2fe984aab30af9c0faf1db0dd9c68b7861e979 (diff)
downloadpesto-bd79768bac0e5d9b0578cb07aa2d9fa9bc4ddb8b.tar.gz
pesto-bd79768bac0e5d9b0578cb07aa2d9fa9bc4ddb8b.tar.bz2
pesto-bd79768bac0e5d9b0578cb07aa2d9fa9bc4ddb8b.zip
GHC 7.8 compatibility
Diffstat (limited to 'src/Codec/Pesto')
-rw-r--r--src/Codec/Pesto/Parse.lhs7
1 files changed, 7 insertions, 0 deletions
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