megaparsec-tests 9.8.0 → 9.8.1
raw patch · 3 files changed
+21/−8 lines, 3 filesdep ~basedep ~megaparsecPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base, megaparsec
API changes (from Hackage documentation)
- Test.Hspec.Megaparsec.AdHoc: instance Test.QuickCheck.Arbitrary.Arbitrary GHC.Internal.Base.Void
+ Test.Hspec.Megaparsec.AdHoc: instance Test.QuickCheck.Arbitrary.Arbitrary GHC.Base.Void
Files
- megaparsec-tests.cabal +8/−6
- tests/Text/Megaparsec/ErrorSpec.hs +10/−0
- tests/Text/Megaparsec/StreamSpec.hs +3/−2
megaparsec-tests.cabal view
@@ -1,11 +1,13 @@ cabal-version: 2.4 name: megaparsec-tests-version: 9.8.0+version: 9.8.1 license: BSD-2-Clause license-file: LICENSE.md maintainer: Mark Karpov <markkarpov92@gmail.com> author: Megaparsec contributors-tested-with: ghc ==9.10.3 ghc ==9.12.4 ghc ==9.14.1+tested-with:+ ghc ==9.6.7 ghc ==9.8.4 ghc ==9.10.3 ghc ==9.12.4 ghc ==9.14.1+ homepage: https://github.com/mrkkrp/megaparsec bug-reports: https://github.com/mrkkrp/megaparsec/issues synopsis: Test utilities and the test suite of Megaparsec@@ -25,12 +27,12 @@ default-language: Haskell2010 build-depends: QuickCheck >=2.17 && <2.19,- base >=4.15 && <5,+ base >=4.18 && <5, bytestring >=0.2 && <0.13, containers >=0.5 && <0.9, hspec >=2 && <3, hspec-megaparsec >=2 && <3,- megaparsec ==9.8.0,+ megaparsec ==9.8.1, mtl >=2.2.2 && <3, text >=0.2 && <2.2, transformers >=0.4 && <0.7@@ -64,13 +66,13 @@ default-language: Haskell2010 build-depends: QuickCheck >=2.17 && <2.19,- base >=4.15 && <5,+ base >=4.18 && <5, bytestring >=0.2 && <0.13, case-insensitive >=1.2 && <1.3, containers >=0.5 && <0.9, hspec >=2 && <3, hspec-megaparsec >=2 && <3,- megaparsec ==9.8.0,+ megaparsec ==9.8.1, megaparsec-tests, mtl >=2.2.2 && <3, scientific >=0.3.1 && <0.4,
tests/Text/Megaparsec/ErrorSpec.hs view
@@ -106,6 +106,16 @@ pe = err 4 (utok 'd' <> etok 'x') :: PE mkBundlePE s pe `shouldBe` "1:4:\n |\n1 | abc\SOHdef\SOHghi\n | ^\nunexpected 'd'\nexpecting 'x'\n"+ it "shows position marker for newline errors at end of line" $ do+ let s = "abc\n" :: String+ pe = err 3 (utok '\n' <> elabel "end of line") :: PE+ mkBundlePE s pe+ `shouldBe` "1:4:\n |\n1 | abc\n | ^\nunexpected newline\nexpecting end of line\n"+ it "shows position marker for other control characters at end of line" $ do+ let s = "xyz\r" :: String+ pe = err 3 (utok '\r' <> etok 'a') :: PE+ mkBundlePE s pe+ `shouldBe` "1:4:\n |\n1 | xyz\r\n | ^\nunexpected carriage return\nexpecting 'a'\n" it "uses continuous highlighting properly (trivial)" $ do let s = "\tfoobar" :: String pe = err 1 (utoks "foo" <> utoks "rar") :: PE
tests/Text/Megaparsec/StreamSpec.hs view
@@ -8,6 +8,7 @@ import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as BL import Data.Char (chr, isControl, isLetter, isSpace)+import qualified Data.List import Data.List.NonEmpty (NonEmpty (..)) import qualified Data.List.NonEmpty as NE import Data.Proxy@@ -519,7 +520,7 @@ property $ \os' (NonNegative d) s -> do let os = getNonNegative <$> os' s' :: PosState String- s' = foldl' f s os+ s' = Data.List.foldl' f s os o' = case os of [] -> d xs -> maximum xs + d@@ -576,7 +577,7 @@ property $ \os' (NonNegative d) s -> do let os = getNonNegative <$> os' s' :: PosState String- s' = foldl' f s os+ s' = Data.List.foldl' f s os o' = case os of [] -> d xs -> maximum xs + d