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 | |
parent | 4d2fe984aab30af9c0faf1db0dd9c68b7861e979 (diff) | |
download | pesto-bd79768bac0e5d9b0578cb07aa2d9fa9bc4ddb8b.tar.gz pesto-bd79768bac0e5d9b0578cb07aa2d9fa9bc4ddb8b.tar.bz2 pesto-bd79768bac0e5d9b0578cb07aa2d9fa9bc4ddb8b.zip |
GHC 7.8 compatibility
-rw-r--r-- | Pesto.cabal | 12 | ||||
-rw-r--r-- | src/Codec/Pesto/Parse.lhs | 7 |
2 files changed, 12 insertions, 7 deletions
diff --git a/Pesto.cabal b/Pesto.cabal index b42c491..b294013 100644 --- a/Pesto.cabal +++ b/Pesto.cabal @@ -1,6 +1,3 @@ --- Initial Pesto.cabal generated by cabal init. For further documentation, --- see http://haskell.org/cabal/users-guide/ - name: Pesto version: 0.1.0.0 -- synopsis: @@ -15,11 +12,12 @@ build-type: Simple -- extra-source-files: cabal-version: >=1.10 +-- parsec>=3.1.9 has instance Eq ParseError library exposed-modules: Codec.Pesto, Codec.Pesto.Parse, Codec.Pesto.Graph, Codec.Pesto.Lint, Codec.Pesto.Serialize -- other-modules: -- other-extensions: - build-depends: base >=4.6 && <4.7, HUnit, parsec + build-depends: base >=4.6 && <4.9, HUnit, parsec >= 3.1.9 hs-source-dirs: src default-language: Haskell2010 ghc-options: -Werror -Wall -fno-warn-missing-signatures @@ -28,7 +26,7 @@ executable pesto main-is: Main.lhs hs-source-dirs: src default-language: Haskell2010 - build-depends: base >=4.6 && <4.7, HUnit, parsec + build-depends: base >=4.6 && <4.9, HUnit, parsec >= 3.1.9 ghc-options: -Werror -Wall -fno-warn-missing-signatures test-suite pesto-test @@ -36,13 +34,13 @@ test-suite pesto-test main-is: Test.lhs hs-source-dirs: src default-language: Haskell2010 - build-depends: base >=4.6 && <4.7, Pesto, HUnit, parsec + build-depends: base >=4.6 && <4.9, Pesto, HUnit, parsec >= 3.1.9 ghc-options: -Werror -Wall -fno-warn-missing-signatures executable pesto-doc main-is: Doc.lhs hs-source-dirs: src default-language: Haskell2010 - build-depends: base >=4.6 && <4.7, pandoc >=1.14, highlighting-kate, blaze-html, filepath, containers + build-depends: base >=4.6 && <4.9, pandoc >=1.14, highlighting-kate, blaze-html, filepath, containers ghc-options: -Werror -Wall -fno-warn-missing-signatures 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 |