packages feed

hspec-megaparsec 2.2.0 → 2.2.1

raw patch · 6 files changed

+29/−41 lines, 6 filesdep −containersdep ~basedep ~hspecdep ~megaparsecsetup-changed

Dependencies removed: containers

Dependency ranges changed: base, hspec, megaparsec

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+## Hspec Megaparsec 2.2.1++* Maintenance release with more modern and minimal dependencies.+ ## Hspec Megaparsec 2.2.0  * Works with Megaparsec 9.
README.md view
@@ -8,9 +8,7 @@  The package is the recommended library for testing [`Megaparsec`](https://hackage.haskell.org/package/megaparsec) parsers with-with [`Hspec`](https://hackage.haskell.org/package/hspec). As of Megaparsec-5.1.0, its test suite is re-written with Hspec and this package with a few-ad-hoc helpers.+with [`Hspec`](https://hackage.haskell.org/package/hspec).  Consult the Haddocks for usage, which should be trivial. Also see test suite of this package or [Megaparsec test
− Setup.hs
@@ -1,6 +0,0 @@-module Main (main) where--import Distribution.Simple--main :: IO ()-main = defaultMain
Test/Hspec/Megaparsec.hs view
@@ -37,7 +37,7 @@ where  import Control.Monad (unless)-import qualified Data.List.NonEmpty as NE+import Data.List.NonEmpty qualified as NE import Test.Hspec.Expectations import Text.Megaparsec import Text.Megaparsec.Error.Builder@@ -65,7 +65,8 @@ r `shouldParse` v = case r of   Left e ->     expectationFailure $-      "expected: " ++ show v+      "expected: "+        ++ show v         ++ "\nbut parsing failed with error:\n"         ++ showBundle e   Right x -> x `shouldBe` v@@ -152,7 +153,7 @@   Expectation r `shouldFailWith` perr1 = r `shouldFailWithM` [perr1] --- | Similar to 'shouldFailWith', but allows to check parsers that can+-- | Similar to 'shouldFailWith', but allows us to check parsers that can -- report more than one parse error at a time. -- -- @since 2.0.0@@ -179,7 +180,8 @@         perrs0 = bundleErrors e0         perrs1 = NE.fromList perrs1'      in unless (perrs0 == perrs1) . expectationFailure $-          "the parser is expected to fail with:\n" ++ showBundle e1+          "the parser is expected to fail with:\n"+            ++ showBundle e1             ++ "but it failed with:\n"             ++ showBundle e0   Right v ->@@ -309,7 +311,8 @@   Expectation checkUnconsumed e a =   unless (e == a) . expectationFailure $-    "the parser is expected to leave unconsumed input: " ++ show e+    "the parser is expected to leave unconsumed input: "+      ++ show e       ++ "\nbut it left this: "       ++ show a 
hspec-megaparsec.cabal view
@@ -1,11 +1,11 @@-cabal-version:   1.18+cabal-version:   2.4 name:            hspec-megaparsec-version:         2.2.0-license:         BSD3+version:         2.2.1+license:         BSD-3-Clause license-file:    LICENSE.md maintainer:      Mark Karpov <markkarpov92@gmail.com> author:          Mark Karpov <markkarpov92@gmail.com>-tested-with:     ghc ==8.6.5 ghc ==8.8.4 ghc ==8.10.1+tested-with:     ghc ==9.4.7 ghc ==9.6.3 ghc ==9.8.1 homepage:        https://github.com/mrkkrp/hspec-megaparsec bug-reports:     https://github.com/mrkkrp/hspec-megaparsec/issues synopsis:        Utility functions for testing Megaparsec parsers with Hspec@@ -29,38 +29,33 @@  library     exposed-modules:  Test.Hspec.Megaparsec-    default-language: Haskell2010+    default-language: GHC2021     build-depends:-        base >=4.12 && <5.0,-        containers >=0.5 && <0.7,+        base >=4.15 && <5,         hspec-expectations >=0.8 && <0.9,-        megaparsec >=9.0 && <10.0+        megaparsec >=9 && <10      if flag(dev)-        ghc-options: -Wall -Werror+        ghc-options: -Wall -Werror -Wpartial-fields -Wunused-packages      else         ghc-options: -Wall -    if flag(dev)-        ghc-options:-            -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns-            -Wnoncanonical-monad-instances- test-suite tests     type:             exitcode-stdio-1.0     main-is:          Main.hs     hs-source-dirs:   tests-    default-language: Haskell2010+    default-language: GHC2021     build-depends:-        base >=4.12 && <5.0,-        hspec >=2.0 && <3.0,-        hspec-expectations >=0.8 && <0.9,-        hspec-megaparsec -any,-        megaparsec >=9.0 && <10.0+        base >=4.15 && <5,+        hspec >=2 && <3,+        hspec-megaparsec,+        megaparsec >=9 && <10      if flag(dev)-        ghc-options: -Wall -Werror+        ghc-options:+            -Wall -Werror -Wredundant-constraints -Wpartial-fields+            -Wunused-packages      else         ghc-options: -Wall
tests/Main.hs view
@@ -1,5 +1,3 @@-{-# LANGUAGE CPP #-}- module Main (main) where  import Data.Void@@ -7,10 +5,6 @@ import Test.Hspec.Megaparsec import Text.Megaparsec import Text.Megaparsec.Char--#if !MIN_VERSION_base(4,13,0)-import Data.Semigroup ((<>))-#endif  type Parser = Parsec Void String