From b39200ab7e8159aa9131bdc2c5bc89654f100034 Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Sat, 19 Aug 2017 15:43:21 +0100 Subject: [PATCH] Test case doesn't actually need three preemptions --- dejafu-tests/Examples/AutoUpdate.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dejafu-tests/Examples/AutoUpdate.hs b/dejafu-tests/Examples/AutoUpdate.hs index 7ecb260..e4e7183 100755 --- a/dejafu-tests/Examples/AutoUpdate.hs +++ b/dejafu-tests/Examples/AutoUpdate.hs @@ -43,20 +43,21 @@ import Control.Monad import Control.Monad.Conc.Class -- test imports -import Test.DejaFu (Bounds(..), Failure(..), defaultBounds, gives) +import Test.DejaFu (Failure(..), gives) import Utils tests :: [T] tests = - [ T "deadlocks" deadlocks (gives [Left Deadlock, Right ()]) - , BT "nondeterministic" nondeterministic (gives [Left Deadlock, Right 0, Right 1]) (defaultBounds { boundPreemp = Just 3 }) + [ T "deadlocks" deadlocks (gives [Left Deadlock, Right ()]) + , T "nondeterministic" nondeterministic (gives [Left Deadlock, Right 0, Right 1]) ] -- This exhibits a deadlock with no preemptions. deadlocks :: MonadConc m => m () deadlocks = join (mkAutoUpdate defaultUpdateSettings) --- This exhibits nondeterminism with three preemptions. +-- This exhibits nondeterminism with three preemptions. However, as +-- the program explicitly yields, the bounds don't need changing. nondeterministic :: forall m. MonadConc m => m Int nondeterministic = do var <- newCRef 0