diff options
| author | Lars-Dominik Braun <lars@6xq.net> | 2016-05-08 11:47:54 +0200 |
|---|---|---|
| committer | Lars-Dominik Braun <lars@6xq.net> | 2016-05-08 11:47:54 +0200 |
| commit | bd79768bac0e5d9b0578cb07aa2d9fa9bc4ddb8b (patch) | |
| tree | 46352e1b56fa2aedf27890dce4f7d4e44ddc82e8 /src | |
| parent | 4d2fe984aab30af9c0faf1db0dd9c68b7861e979 (diff) | |
| download | pesto-bd79768bac0e5d9b0578cb07aa2d9fa9bc4ddb8b.tar.gz pesto-bd79768bac0e5d9b0578cb07aa2d9fa9bc4ddb8b.tar.bz2 pesto-bd79768bac0e5d9b0578cb07aa2d9fa9bc4ddb8b.zip | |
GHC 7.8 compatibility
Diffstat (limited to 'src')
| -rw-r--r-- | src/Codec/Pesto/Parse.lhs | 7 |
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 |
