Skip to content

Commit

Permalink
Restore the Size arguments for backwards compatibility.
Browse files Browse the repository at this point in the history
They're ignored, but this means hspec-hedgohog works again.

Also, there was a parameter named `size` that should have been named
`seed`.
  • Loading branch information
ChickenProp committed Mar 14, 2024
1 parent c65dc16 commit 732264c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
12 changes: 7 additions & 5 deletions hedgehog/src/Hedgehog/Internal/Runner.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ->
Expand Down Expand Up @@ -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.
--
Expand All @@ -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.
Expand Down
1 change: 1 addition & 0 deletions hedgehog/test/Test/Hedgehog/Size.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ())
Expand Down
1 change: 1 addition & 0 deletions hedgehog/test/Test/Hedgehog/Skip.hs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ checkProp prop = do
seed <- Config.resolveSeed Nothing
liftIO $ Runner.checkReport
(Property.propertyConfig prop)
undefined
seed
(Property.propertyTest prop)
(const $ pure ())
Expand Down
1 change: 1 addition & 0 deletions hedgehog/test/Test/Hedgehog/State.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ())
Expand Down

0 comments on commit 732264c

Please sign in to comment.