@@ -691,66 +691,67 @@ main = hspec
691691 )
692692
693693 let makeOps t =
694− [ t
694+ [ ("default", t)
695695#ifndef COVERAGE_BUILD
696− , t . maxRate 0
697− , t . maxRate (-1)
698− , t . maxBuffer 0
699− , t . maxBuffer 1
700− , t . maxThreads 0
701− , t . maxThreads 1
702− , t . maxThreads (-1)
696+ , ("maxRate 10000", t . maxRate 10000)
697+ , ("maxRate -1", t . maxRate (-1))
698+ , ("maxBuffer 0", t . maxBuffer 0)
699+ , ("maxBuffer 1", t . maxBuffer 1)
700+ , ("maxThreads 0", t . maxThreads 0)
701+ , ("maxThreads 1", t . maxThreads 1)
702+ , ("maxThreads -1", t . maxThreads (-1))
703703#endif
704704 ]
705705
706+ let mapOps spec = mapM_ (\(desc, f) -> describe desc $ spec f)
706707 let serialOps :: IsStream t => ((SerialT IO a -> t IO a) -> Spec) -> Spec
707− serialOps = forM_ $ (makeOps serially)
708+ serialOps spec = mapOps spec $ (makeOps serially)
708709#ifndef COVERAGE_BUILD
709− ++ [serially . maxRate 0.00000001]
710− ++ [serially . maxBuffer (-1)]
710+ ++ [("maxRate 0.00000001", serially . maxRate 0.00000001)]
711+ ++ [("maxBuffer -1", serially . maxBuffer (-1))]
711712#endif
712713 let wSerialOps :: IsStream t => ((WSerialT IO a -> t IO a) -> Spec) -> Spec
713− wSerialOps = forM_ $ makeOps wSerially
714+ wSerialOps spec = mapOps spec $ makeOps wSerially
714715#ifndef COVERAGE_BUILD
715− ++ [wSerially . maxRate 0.00000001]
716− ++ [wSerially . maxBuffer (-1)]
716+ ++ [("maxRate 0.00000001", wSerially . maxRate 0.00000001)]
717+ ++ [("maxBuffer (-1)", wSerially . maxBuffer (-1))]
717718#endif
718719 let asyncOps :: IsStream t => ((AsyncT IO a -> t IO a) -> Spec) -> Spec
719− asyncOps = forM_ $ makeOps asyncly
720+ asyncOps spec = mapOps spec $ makeOps asyncly
720721#ifndef COVERAGE_BUILD
721− ++ [asyncly . maxRate 10000]
722− ++ [asyncly . maxBuffer (-1)]
722+ ++ [("maxRate 10000", asyncly . maxRate 10000)]
723+ ++ [("maxBuffer (-1)", asyncly . maxBuffer (-1))]
723724#endif
724725 let wAsyncOps :: IsStream t => ((WAsyncT IO a -> t IO a) -> Spec) -> Spec
725− wAsyncOps = forM_ $ makeOps wAsyncly
726+ wAsyncOps spec = mapOps spec $ makeOps wAsyncly
726727#ifndef COVERAGE_BUILD
727− ++ [wAsyncly . maxRate 10000]
728− ++ [wAsyncly . maxBuffer (-1)]
728+ ++ [("maxRate 10000", wAsyncly . maxRate 10000)]
729+ ++ [("maxBuffer (-1)", wAsyncly . maxBuffer (-1))]
729730#endif
730731 let aheadOps :: IsStream t => ((AheadT IO a -> t IO a) -> Spec) -> Spec
731− aheadOps = forM_ $ makeOps aheadly
732+ aheadOps spec = mapOps spec $ makeOps aheadly
732733#ifndef COVERAGE_BUILD
733− ++ [aheadly . maxRate 10000]
734− ++ [aheadly . maxBuffer (-1)]
734+ -- ++ [("maxRate 10000", aheadly . maxRate 10000)]
735+ -- ++ [("maxBuffer (-1)", aheadly . maxBuffer (-1))]
735736#endif
736737 let parallelOps :: IsStream t => ((ParallelT IO a -> t IO a) -> Spec) -> Spec
737− parallelOps = forM_ $ makeOps parallely
738+ parallelOps spec = mapOps spec $ makeOps parallely
738739#ifndef COVERAGE_BUILD
739− ++ [parallely . maxRate 0.00000001]
740− ++ [parallely . maxBuffer (-1)]
740+ ++ [("maxRate 0.00000001", parallely . maxRate 0.00000001)]
741+ ++ [("maxBuffer (-1)", parallely . maxBuffer (-1))]
741742#endif
742743 let zipSerialOps :: IsStream t => ((ZipSerialM IO a -> t IO a) -> Spec) -> Spec
743− zipSerialOps = forM_ $ makeOps zipSerially
744+ zipSerialOps spec = mapOps spec $ makeOps zipSerially
744745#ifndef COVERAGE_BUILD
745− ++ [zipSerially . maxRate 0.00000001]
746− ++ [zipSerially . maxBuffer (-1)]
746+ ++ [("maxRate 0.00000001", zipSerially . maxRate 0.00000001)]
747+ ++ [("maxBuffer (-1)", zipSerially . maxBuffer (-1))]
747748#endif
748749 -- Note, the "pure" of applicative Zip streams generates and infinite
749750 -- stream and therefore maxBuffer (-1) must not be used for that case.
750751 let zipAsyncOps :: IsStream t => ((ZipAsyncM IO a -> t IO a) -> Spec) -> Spec
751− zipAsyncOps = forM_ $ makeOps zipAsyncly
752+ zipAsyncOps spec = mapOps spec $ makeOps zipAsyncly
752753#ifndef COVERAGE_BUILD
753− ++ [zipAsyncly . maxRate 10000]
754+ ++ [("maxRate 10000", zipAsyncly . maxRate 10000)]
754755#endif
755756
756757 describe "Construction" $ do
@@ -898,26 +899,27 @@ main = hspec
898899 -- These tests won't work with maxBuffer or maxThreads set to 1, so we
899900 -- exclude those cases from these.
900901 let mkOps t =
901− [ t
902+ [ ("default", t)
902903#ifndef COVERAGE_BUILD
903− , t . maxRate 0
904− , t . maxRate (-1)
905− , t . maxBuffer 0
906− , t . maxThreads 0
907− , t . maxThreads (-1)
904+ , ("maxRate 0", t . maxRate 0)
905+ , ("maxRate -1", t . maxRate (-1))
906+ , ("maxBuffer 0", t . maxBuffer 0)
907+ , ("maxThreads 0", t . maxThreads 0)
908+ , ("maxThreads 0", t . maxThreads (-1))
908909#endif
909910 ]
910911
912+ let forOps ops spec = forM_ ops (\(desc, f) -> describe desc $ spec f)
911913 describe "Stream concurrent operations" $ do
912− forM_ (mkOps aheadly) $ concurrentOps S.fromFoldable "aheadly" (==)
913− forM_ (mkOps asyncly) $ concurrentOps S.fromFoldable "asyncly" sortEq
914− forM_ (mkOps wAsyncly) $ concurrentOps S.fromFoldable "wAsyncly" sortEq
915− forM_ (mkOps parallely) $ concurrentOps S.fromFoldable "parallely" sortEq
914+ forOps (mkOps aheadly) $ concurrentOps S.fromFoldable "aheadly" (==)
915+ forOps (mkOps asyncly) $ concurrentOps S.fromFoldable "asyncly" sortEq
916+ forOps (mkOps wAsyncly) $ concurrentOps S.fromFoldable "wAsyncly" sortEq
917+ forOps (mkOps parallely) $ concurrentOps S.fromFoldable "parallely" sortEq
916918
917− forM_ (mkOps aheadly) $ concurrentOps folded "aheadly folded" (==)
918− forM_ (mkOps asyncly) $ concurrentOps folded "asyncly folded" sortEq
919− forM_ (mkOps wAsyncly) $ concurrentOps folded "wAsyncly folded" sortEq
920− forM_ (mkOps parallely) $ concurrentOps folded "parallely folded" sortEq
919+ forOps (mkOps aheadly) $ concurrentOps folded "aheadly folded" (==)
920+ forOps (mkOps asyncly) $ concurrentOps folded "asyncly folded" sortEq
921+ forOps (mkOps wAsyncly) $ concurrentOps folded "wAsyncly folded" sortEq
922+ forOps (mkOps parallely) $ concurrentOps folded "parallely folded" sortEq
921923
922924 describe "Concurrent application" $ do
923925 serialOps $ prop "serial" . concurrentApplication (==)
@@ -956,6 +958,11 @@ main = hspec
956958 zipSerialOps $ transformCombineOpsOrdered S.fromFoldable "zipSerially" (==)
957959 zipAsyncOps $ transformCombineOpsOrdered S.fromFoldable "zipAsyncly" (==)
958960
961+ serialOps $ transformCombineOpsOrdered folded "serially" (==)
962+ aheadOps $ transformCombineOpsOrdered folded "aheadly" (==)
963+ zipSerialOps $ transformCombineOpsOrdered folded "zipSerially" (==)
964+ zipAsyncOps $ transformCombineOpsOrdered folded "zipAsyncly" (==)
965+
959966 describe "Stream elimination operations" $ do
960967 serialOps $ eliminationOps S.fromFoldable "serially"
961968 wSerialOps $ eliminationOps S.fromFoldable "wSerially"