doctest 0.11.1 → 0.11.2
raw patch · 3 files changed
+10/−8 lines, 3 filesdep +mockerydep ~ghcPVP ok
version bump matches the API change (PVP)
Dependencies added: mockery
Dependency ranges changed: ghc
API changes (from Hackage documentation)
Files
- doctest.cabal +3/−2
- src/GhcUtil.hs +4/−2
- src/Runner/Example.hs +3/−4
doctest.cabal view
@@ -1,5 +1,5 @@ name: doctest-version: 0.11.1+version: 0.11.2 synopsis: Test interactive Haskell examples description: The doctest program checks examples in source code comments. It is modeled after doctest for Python@@ -51,7 +51,7 @@ build-depends: base == 4.* , base-compat >= 0.7.0- , ghc >= 7.0 && < 8.2+ , ghc >= 7.0 && < 8.4 , syb >= 0.3 , code-page >= 0.1 , deepseq@@ -105,6 +105,7 @@ , silently >= 1.2.4 , setenv , with-location+ , mockery test-suite doctests main-is:
src/GhcUtil.hs view
@@ -20,7 +20,7 @@ import Data.IORef (writeIORef) #elif __GLASGOW_HASKELL__ < 707 import StaticFlags (saveStaticFlagGlobals, restoreStaticFlagGlobals)-#else+#elif __GLASGOW_HASKELL__ < 801 import StaticFlags (discardStaticFlags) #endif @@ -58,8 +58,10 @@ handleStaticFlags :: [String] -> IO [Located String] #if __GLASGOW_HASKELL__ < 707 handleStaticFlags flags = fst `fmap` parseStaticFlags (map noLoc flags)-#else+#elif __GLASGOW_HASKELL__ < 801 handleStaticFlags flags = return $ map noLoc $ discardStaticFlags flags+#else+handleStaticFlags flags = return $ map noLoc $ flags #endif handleDynamicFlags :: GhcMonad m => [Located String] -> m [String]
src/Runner/Example.hs view
@@ -27,13 +27,12 @@ chunksMatch _ _ = False matches :: ExpectedResult -> [String] -> Bool+ matches (ExpectedLine x : xs) (y : ys) = x `chunksMatch` y && xs `matches` ys+ matches (WildCardLine : xs) ys | xs `matches` ys = True+ matches zs@(WildCardLine : _) (_ : ys) = zs `matches` ys matches [] [] = True matches [] _ = False matches _ [] = False- matches (ExpectedLine x : xs) (y:ys) =- x `chunksMatch` y && xs `matches` ys- matches zs@(WildCardLine : xs) (_:ys) =- xs `matches` ys || zs `matches` ys formatNotEqual :: ExpectedResult -> [String] -> [String]