summaryrefslogtreecommitdiff
path: root/src/Codec/Pesto
diff options
context:
space:
mode:
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