@@ -387,7 +387,7 @@ class QCDProp state p | p -> state where
387
387
instance QCDProp state (QCDProperty state ) where
388
388
qcdProperty = id
389
389
390
- instance Testable p => QCDProp state (Actions state -> p ) where
390
+ instance ( StateModel state , Testable p ) => QCDProp state (Actions state -> p ) where
391
391
qcdProperty p = QCDProperty (property . p) defaultOptions
392
392
393
393
modifyOptions :: QCDProperty state -> (Options state -> Options state ) -> QCDProperty state
@@ -399,18 +399,16 @@ moreActions :: QCDProp state p => Rational -> p -> QCDProperty state
399
399
moreActions r p =
400
400
modifyOptions (qcdProperty p) $ \ opts -> opts{actionLengthMultiplier = actionLengthMultiplier opts * r}
401
401
402
- -- NOTE: indexed on state for forwards compatibility, e.g. when we
403
- -- want to give an explicit initial state
404
- data Options state = Options { actionLengthMultiplier :: Rational }
402
+ data Options state = Options { actionLengthMultiplier :: Rational , oInitialState :: Annotated state }
405
403
406
- defaultOptions :: Options state
407
- defaultOptions = Options {actionLengthMultiplier = 1 }
404
+ defaultOptions :: StateModel state => Options state
405
+ defaultOptions = Options {actionLengthMultiplier = 1 , oInitialState = initialAnnotatedState }
408
406
409
407
-- | Generate arbitrary actions with the `GenActionsOptions`. More flexible than using the type-based
410
408
-- modifiers.
411
409
generateActionsWithOptions :: forall state . StateModel state => Options state -> Gen (Actions state )
412
410
generateActionsWithOptions Options {.. } = do
413
- (as, rejected) <- arbActions [] [] initialAnnotatedState 1
411
+ (as, rejected) <- arbActions [] [] oInitialState 1
414
412
return $ Actions_ rejected (Smart 0 as)
415
413
where
416
414
arbActions :: [Step state ] -> [String ] -> Annotated state -> Int -> Gen ([Step state ], [String ])
0 commit comments