hspec-megaparsec 0.2.0 → 0.2.1
raw patch · 3 files changed
+20/−12 lines, 3 filesdep ~basedep ~hspecdep ~hspec-expectations
Dependency ranges changed: base, hspec, hspec-expectations, hspec-megaparsec
Files
- CHANGELOG.md +5/−0
- Test/Hspec/Megaparsec.hs +6/−3
- hspec-megaparsec.cabal +9/−9
CHANGELOG.md view
@@ -1,3 +1,8 @@+## Hspec Megaparsec 0.2.1++* Refreshed obsolete documentation for `shouldFailWith` and how it reports+ not matching parse errors.+ ## Hspec Megaparsec 0.2.0 * This version of `hspec-megaparsec` should be used with Megaparsec 5.
Test/Hspec/Megaparsec.hs view
@@ -96,8 +96,11 @@ -- parse errors to check against. See "Text.Megaparsec.Pos" for functions to -- construct textual positions. ----- > parse (char 'x') "" "b" `shouldFailWith`--- > newErrorMessages [Unexpected "'b'", Expected "'x'"] (initialPos "")+-- > parse (char 'x') "" "b" `shouldFailWith` ParseError+-- > { errorPos = initialPos "" :| []+-- > , errorUnexpected = Set.singleton (Tokens $ 'b' :| [])+-- > , errorExpected = Set.singleton (Tokens $ 'x' :| [])+-- > , errorCustom = Set.empty } shouldFailWith :: (Ord t, ShowToken t, ShowErrorComponent e, Show a) => Either (ParseError t e) a@@ -106,7 +109,7 @@ r `shouldFailWith` e = case r of Left e' -> unless (e == e') . expectationFailure $ "the parser is expected to fail with:\n" ++ showParseError e ++- "but it failed with:\n" ++ showParseError e+ "but it failed with:\n" ++ showParseError e' Right v -> expectationFailure $ "the parser is expected to fail, but it parsed: " ++ show v
hspec-megaparsec.cabal view
@@ -31,7 +31,7 @@ -- POSSIBILITY OF SUCH DAMAGE. name: hspec-megaparsec-version: 0.2.0+version: 0.2.1 cabal-version: >= 1.10 license: BSD3 license-file: LICENSE.md@@ -52,9 +52,9 @@ default: False library- build-depends: base >= 4.6 && < 5+ build-depends: base >= 4.6 && < 5.0 , containers >= 0.5 && < 0.6- , hspec-expectations >= 0.5+ , hspec-expectations >= 0.5 && < 0.8 , megaparsec >= 5.0 && < 6.0 if !impl(ghc >= 8.0)@@ -62,7 +62,7 @@ exposed-modules: Test.Hspec.Megaparsec if flag(dev)- ghc-options: -Wall+ ghc-options: -Wall -Werror else ghc-options: -Wall default-language: Haskell2010@@ -72,14 +72,14 @@ hs-source-dirs: tests type: exitcode-stdio-1.0 if flag(dev)- ghc-options: -Wall+ ghc-options: -Wall -Werror else ghc-options: -Wall- build-depends: base >= 4.6 && < 5+ build-depends: base >= 4.6 && < 5.0 , containers >= 0.5 && < 0.6- , hspec >= 2.0- , hspec-expectations >= 0.5- , hspec-megaparsec >= 0.2+ , hspec >= 2.0 && < 3.0+ , hspec-expectations >= 0.5 && < 0.8+ , hspec-megaparsec >= 0.2.1 , megaparsec >= 5.0 && < 6.0 if !impl(ghc >= 8.0) build-depends: semigroups == 0.18.*