@@ -19,7 +19,7 @@ import Control.Monad (void, when, forM_, replicateM_)
19import Control.Monad.IO.Class (MonadIO(liftIO))
19import Control.Monad.IO.Class (MonadIO(liftIO))
20import Control.Monad.State (MonadState, get, modify, runStateT
20import Control.Monad.State (MonadState, get, modify, runStateT
21 , StateT(..), evalStateT)
21 , StateT(..), evalStateT)
22−import Data.Foldable (fold)
22+import Data.Foldable (fold)
23import Data.IORef (readIORef, modifyIORef, newIORef)
23import Data.IORef (readIORef, modifyIORef, newIORef)
24#if !(MIN_VERSION_base(4,11,0))
24#if !(MIN_VERSION_base(4,11,0))
25import Data.Semigroup (Semigroup, (<>))
25import Data.Semigroup (Semigroup, (<>))
@@ -410,7 +410,7 @@ main = hspec
410 concurrentFoldrApplication
410 concurrentFoldrApplication
411 prop "concurrent foldl application" $ withMaxSuccess maxTestCount
411 prop "concurrent foldl application" $ withMaxSuccess maxTestCount
412 concurrentFoldlApplication
412 concurrentFoldlApplication
414 describe "take on infinite concurrent stream" $ takeInfinite asyncly
414 describe "take on infinite concurrent stream" $ takeInfinite asyncly
415 describe "take on infinite concurrent stream" $ takeInfinite wAsyncly
415 describe "take on infinite concurrent stream" $ takeInfinite wAsyncly
416 describe "take on infinite concurrent stream" $ takeInfinite aheadly
416 describe "take on infinite concurrent stream" $ takeInfinite aheadly
@@ -418,7 +418,7 @@ main = hspec
418 ---------------------------------------------------------------------------
418 ---------------------------------------------------------------------------
419 -- Monadic state transfer in concurrent tasks
419 -- Monadic state transfer in concurrent tasks
420 ---------------------------------------------------------------------------
420 ---------------------------------------------------------------------------
422 describe "Monadic state transfer in concurrent tasks" $ do
422 describe "Monadic state transfer in concurrent tasks" $ do
423 -- XXX Can we write better test cases to hit every case?
423 -- XXX Can we write better test cases to hit every case?
424 it "async: state is saved and used if the work is partially enqueued"
424 it "async: state is saved and used if the work is partially enqueued"
@@ -478,6 +478,7 @@ main = hspec
478 replicate 4000 $ S.yieldM $ threadDelay 1000000)
478 replicate 4000 $ S.yieldM $ threadDelay 1000000)
479 `shouldReturn` ()
479 `shouldReturn` ()
481 describe "restricts concurrency and cleans up extra tasks" $ do
482 describe "restricts concurrency and cleans up extra tasks" $ do
482 it "take 1 asyncly" $ checkCleanup 2 asyncly (S.take 1)
483 it "take 1 asyncly" $ checkCleanup 2 asyncly (S.take 1)
483 it "take 1 wAsyncly" $ checkCleanup 2 wAsyncly (S.take 1)
484 it "take 1 wAsyncly" $ checkCleanup 2 wAsyncly (S.take 1)
@@ -486,3 +487,4 @@ main = hspec
486 it "takeWhile (< 0) asyncly" $ checkCleanup 2 asyncly (S.takeWhile (< 0))
487 it "takeWhile (< 0) asyncly" $ checkCleanup 2 asyncly (S.takeWhile (< 0))
487 it "takeWhile (< 0) wAsyncly" $ checkCleanup 2 wAsyncly (S.takeWhile (< 0))
488 it "takeWhile (< 0) wAsyncly" $ checkCleanup 2 wAsyncly (S.takeWhile (< 0))
488 it "takeWhile (< 0) aheadly" $ checkCleanup 2 aheadly (S.takeWhile (< 0))
489 it "takeWhile (< 0) aheadly" $ checkCleanup 2 aheadly (S.takeWhile (< 0))