Fix test compilation errors with latest deps

I'm going to drop support for GHC 8.0, which'll mean I can also drop
this janky vendored tasty-hedgehog.
This commit is contained in:
Michael Walker 2023-06-17 22:12:01 +01:00
parent 691b496312
commit a33560db15
No known key found for this signature in database
2 changed files with 16 additions and 14 deletions

View File

@ -90,7 +90,10 @@ import System.IO.Unsafe (unsafePerformIO)
import qualified System.Random.MWC as Random
import Control.DeepSeq
import Control.Monad (replicateM)
import Control.Monad (join,
replicateM,
unless)
import Data.Foldable (forM_)
import qualified Data.Set as S
import Data.Word (Word64)

View File

@ -164,7 +164,7 @@ instance IsOption HedgehogShrinkRetries where
getReport :: Report a -> (TestCount, a)
#if MIN_VERSION_hedgehog(1,0,0)
getReport (Report testCount _ _ status) = (testCount, status)
getReport r = (reportTests r, reportStatus r)
#else
getReport (Report testCount _ status) = (testCount, status)
#endif
@ -198,25 +198,24 @@ reportOutput :: Bool
-> String
-> Report Result
-> IO String
reportOutput _ showReplay name report = do
reportOutput _ _ name report = do
let (_, status) = getReport report
-- TODO add details for tests run / discarded / shrunk
s <- renderResult' (Just (PropertyName name)) report
pure $ case status of
Failed fr -> do
let
size = failureSize fr
seed = failureSeed fr
replayStr =
if showReplay
then "\nUse '--hedgehog-replay \"" ++ show size ++ " " ++ show seed ++ "\"' to reproduce."
else ""
s ++ replayStr
Failed _ -> s
GaveUp -> "Gave up"
OK -> "OK"
propertyConfig' :: TestLimit -> DiscardLimit -> ShrinkLimit -> ShrinkRetries -> PropertyConfig
#if MIN_VERSION_hedgehog(1,0,2)
#if MIN_VERSION_hedgehog(1,2,0)
propertyConfig' testLimit discardLimit shrinkLimit shrinkRetries = PropertyConfig
{ propertyDiscardLimit = discardLimit
, propertyShrinkLimit = shrinkLimit
, propertyShrinkRetries = shrinkRetries
, propertyTerminationCriteria = NoConfidenceTermination testLimit
, propertySkip = Nothing
}
#elif MIN_VERSION_hedgehog(1,0,2)
propertyConfig' testLimit discardLimit shrinkLimit shrinkRetries = PropertyConfig
{ propertyDiscardLimit = discardLimit
, propertyShrinkLimit = shrinkLimit