File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ module Test.QuickCheck.Extras where
22
33import Control.Monad.Reader
44import Control.Monad.State
5+ import Test.QuickCheck
56import Test.QuickCheck.Monadic
67
78runPropertyStateT :: Monad m => PropertyM (StateT s m ) a -> s -> PropertyM m (a , s )
@@ -13,3 +14,9 @@ runPropertyReaderT :: Monad m => PropertyM (ReaderT e m) a -> e -> PropertyM m a
1314runPropertyReaderT p e = MkPropertyM $ \ k -> do
1415 m <- unPropertyM p $ fmap lift . k
1516 return $ runReaderT m e
17+
18+ sometimes :: Testable p => Int -> p -> Property
19+ sometimes i = disjoin . replicate i
20+
21+ always :: Testable p => Int -> p -> Property
22+ always i = conjoin . replicate i
Original file line number Diff line number Diff line change @@ -120,6 +120,6 @@ instance RunModelPar Counter (ReaderT (IORef Int) IO) where
120120 postconditionPar _ _ _ _ = pure True
121121
122122prop_counter_par :: ParallelActions Counter -> Property
123- prop_counter_par as = monadicIO $ do
123+ prop_counter_par as = always 10 $ monadicIO $ do
124124 ref <- lift $ newIORef (0 :: Int )
125125 runPropertyReaderT (runParActions as) ref
You can’t perform that action at this time.
0 commit comments