From 732264c074b986f00ded1a0dda88d3f4029a150f Mon Sep 17 00:00:00 2001 From: Phil Hazelden Date: Wed, 1 Mar 2023 10:49:08 +0000 Subject: [PATCH] Restore the `Size` arguments for backwards compatibility. They're ignored, but this means hspec-hedgohog works again. Also, there was a parameter named `size` that should have been named `seed`. --- hedgehog/src/Hedgehog/Internal/Runner.hs | 12 +++++++----- hedgehog/test/Test/Hedgehog/Size.hs | 1 + hedgehog/test/Test/Hedgehog/Skip.hs | 1 + hedgehog/test/Test/Hedgehog/State.hs | 1 + 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/hedgehog/src/Hedgehog/Internal/Runner.hs b/hedgehog/src/Hedgehog/Internal/Runner.hs index 38d42bf3..2654e31e 100644 --- a/hedgehog/src/Hedgehog/Internal/Runner.hs +++ b/hedgehog/src/Hedgehog/Internal/Runner.hs @@ -206,11 +206,12 @@ checkReport :: MonadIO m => MonadCatch m => PropertyConfig + -> Size -- ^ ignored, but retained for backwards compatibility -> Seed -> PropertyT m () -> (Report Progress -> m ()) -> m (Report Result) -checkReport cfg seed0 test0 updateUI = do +checkReport cfg _ seed0 test0 updateUI = do skip <- liftIO $ resolveSkip $ propertySkip cfg let @@ -436,13 +437,14 @@ checkRegion :: => Region -> UseColor -> Maybe PropertyName + -> Size -- ^ ignored, but retained for backwards compatibility -> Seed -> Property -> m (Report Result) -checkRegion region color name size prop = +checkRegion region color name _ seed prop = liftIO $ do result <- - checkReport (propertyConfig prop) size (propertyTest prop) $ \progress -> do + checkReport (propertyConfig prop) undefined seed (propertyTest prop) $ \progress -> do ppprogress <- renderProgress color name progress case reportStatus progress of Running -> @@ -471,7 +473,7 @@ checkNamed :: -> m (Report Result) checkNamed region color name mseed prop = do seed <- resolveSeed mseed - checkRegion region color name seed prop + checkRegion region color name undefined seed prop -- | Check a property. -- @@ -488,7 +490,7 @@ recheckAt seed skip prop0 = do color <- detectColor let prop = withSkip skip prop0 _ <- liftIO . displayRegion $ \region -> - checkRegion region color Nothing seed prop + checkRegion region color Nothing undefined seed prop pure () -- | Check a group of properties using the specified runner config. diff --git a/hedgehog/test/Test/Hedgehog/Size.hs b/hedgehog/test/Test/Hedgehog/Size.hs index 460b721f..47722897 100644 --- a/hedgehog/test/Test/Hedgehog/Size.hs +++ b/hedgehog/test/Test/Hedgehog/Size.hs @@ -21,6 +21,7 @@ checkProp :: MonadIO m => Property -> m (Report Result) checkProp prop = do seed <- Config.resolveSeed Nothing liftIO $ Runner.checkReport (Property.propertyConfig prop) + undefined seed (Property.propertyTest prop) (const $ pure ()) diff --git a/hedgehog/test/Test/Hedgehog/Skip.hs b/hedgehog/test/Test/Hedgehog/Skip.hs index da871de0..af815f35 100644 --- a/hedgehog/test/Test/Hedgehog/Skip.hs +++ b/hedgehog/test/Test/Hedgehog/Skip.hs @@ -57,6 +57,7 @@ checkProp prop = do seed <- Config.resolveSeed Nothing liftIO $ Runner.checkReport (Property.propertyConfig prop) + undefined seed (Property.propertyTest prop) (const $ pure ()) diff --git a/hedgehog/test/Test/Hedgehog/State.hs b/hedgehog/test/Test/Hedgehog/State.hs index c5b57b28..d3173ccb 100644 --- a/hedgehog/test/Test/Hedgehog/State.hs +++ b/hedgehog/test/Test/Hedgehog/State.hs @@ -82,6 +82,7 @@ prop_mkInput = -- logs. seed <- Config.resolveSeed Nothing void $ liftIO $ Runner.checkReport (Property.propertyConfig prop) + undefined seed (Property.propertyTest prop) (const $ pure ())