Unverified Commit 03f211cc authored by Oleg Grenrus's avatar Oleg Grenrus Committed by GitHub

Merge pull request #6598 from phadej/testing

Add forEachGPD to hackage-tests
parents eba38fc8 ec0e1d3d
......@@ -131,19 +131,26 @@ readFieldTest fpath bs = case Parsec.readFields bs' of
parseParsecTest :: Bool -> FilePath -> B.ByteString -> IO ThreeInt
parseParsecTest keepGoing fpath bs = do
let (warnings, parsec) = Parsec.runParseResult $
Parsec.parseGenericPackageDescription bs
let (warnings, result) = Parsec.runParseResult $
Parsec.parseGenericPackageDescription bs
let w | null warnings = 0
| otherwise = 1
case parsec of
Right _ -> return (ThreeInt 1 w 0)
Left (_, errors) | keepGoing -> return (ThreeInt 1 w 1)
| otherwise -> do
case result of
Right gpd -> do
forEachGPD fpath bs gpd
return (ThreeInt 1 w 0)
Left (_, errors) | keepGoing -> return (ThreeInt 1 w 1)
| otherwise -> do
traverse_ (putStrLn . Parsec.showPError fpath) errors
exitFailure
-- | A hook to make queries on Hackage
forEachGPD :: FilePath -> B8.ByteString -> L.GenericPackageDescription -> IO ()
forEachGPD _ _ _ = return ()
-------------------------------------------------------------------------------
-- ThreeInt
-------------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment