@@ -2,204 +2,33 @@
3module Main (main) where
3module Main (main) where
5−import Control.Applicative (ZipList(..), liftA2)
5+import Control.Applicative (ZipList(..))
6import Control.Concurrent (MVar, takeMVar, putMVar, newEmptyMVar)
6import Control.Concurrent (MVar, takeMVar, putMVar, newEmptyMVar)
7import Control.Exception
7import Control.Exception
8 (BlockedIndefinitelyOnMVar(..), catches,
8 (BlockedIndefinitelyOnMVar(..), catches,
9 BlockedIndefinitelyOnSTM(..), Handler(..))
9 BlockedIndefinitelyOnSTM(..), Handler(..))
10−import Control.Monad (when, forM_, replicateM, replicateM_)
10+import Control.Monad (when, forM_, replicateM_)
11−import Control.Monad.IO.Class (MonadIO(..))
12−import Data.Function ((&))
13−import Data.IORef (readIORef, modifyIORef, newIORef, modifyIORef', IORef)
11+import Data.IORef (readIORef, modifyIORef, newIORef)
14−import Data.List
12+import Data.List (sort)
15− (sort, foldl', scanl', findIndices, findIndex, elemIndices,
16− elemIndex, find, insertBy, intersperse, foldl1', (\\),
17− maximumBy, minimumBy, deleteBy, isPrefixOf, isSubsequenceOf,
18− stripPrefix, intercalate)
19−import Data.Maybe (mapMaybe)
20import GHC.Word (Word8)
13import GHC.Word (Word8)
22import Test.Hspec.QuickCheck
15import Test.Hspec.QuickCheck
23import Test.QuickCheck
16import Test.QuickCheck
24− (counterexample, Property, withMaxSuccess, forAll, choose, Gen,
17+ (Property, withMaxSuccess)
25− arbitrary, elements, frequency, listOf, vectorOf) --, listOf1, suchThat)
26−import Test.QuickCheck.Monadic (run, monadicIO, monitor, assert, PropertyM)
18+import Test.QuickCheck.Monadic (monadicIO, run)
28import Test.Hspec as H
20import Test.Hspec as H
30import Streamly
22import Streamly
31−import Streamly.Prelude ((.:), nil)
32import Streamly as S
23import Streamly as S
33import qualified Streamly.Prelude as S
24import qualified Streamly.Prelude as S
34−import qualified Streamly.Data.Fold as FL
35−import qualified Streamly.Internal.Data.Fold as FL
37−maxStreamLen :: Int
26+import Streamly.Test.Common
38−maxStreamLen = 1000
27+import Streamly.Test.Prelude
40−-- Coverage build takes too long with default number of tests
48−singleton :: IsStream t => a -> t m a
49−singleton a = a .: nil
51sortEq :: Ord a => [a] -> [a] -> Bool
29sortEq :: Ord a => [a] -> [a] -> Bool
52sortEq a b = sort a == sort b
30sortEq a b = sort a == sort b
56− => (a -> a -> Bool) -> a -> a -> PropertyM m ()
57−equals eq stream list = do
58− when (not $ stream `eq` list) $
61− "stream " <> show stream
62− <> "\nlist " <> show list
64− assert (stream `eq` list)
67− :: (Show a, Eq a, MonadIO m)
68− => ([a] -> [a] -> Bool) -> [a] -> [a] -> PropertyM m ()
69−listEquals eq stream list = do
70− when (not $ stream `eq` list) $ liftIO $ putStrLn $
71− "stream " <> show stream
72− <> "\nlist " <> show list
73− <> "\nstream \\\\ list " <> show (stream \\ list)
74− <> "\nlist \\\\ stream " <> show (list \\ stream)
75− when (not $ stream `eq` list) $
78− "stream " <> show stream
79− <> "\nlist " <> show list
80− <> "\nstream \\\\ list " <> show (stream \\ list)
81− <> "\nlist \\\\ stream " <> show (list \\ stream)
83− assert (stream `eq` list)
85−-------------------------------------------------------------------------------
86−-- Construction operations
87−-------------------------------------------------------------------------------
93− -> (t IO a -> SerialT IO a)
96−constructWithLen mkStream mkList op len = withMaxSuccess maxTestCount $
98− stream <- run $ (S.toList . op) (mkStream (fromIntegral len))
99− let list = mkList (fromIntegral len)
100− listEquals (==) stream list
103− :: (Int -> t IO Int)
104− -> (Int -> IO [Int])
105− -> (t IO Int -> SerialT IO Int)
108−constructWithLenM mkStream mkList op len = withMaxSuccess maxTestCount $
110− stream <- run $ (S.toList . op) (mkStream (fromIntegral len))
111− list <- run $ mkList (fromIntegral len)
112− listEquals (==) stream list
114−constructWithReplicate, constructWithReplicateM, constructWithIntFromThenTo
116− => (t IO Int -> SerialT IO Int)
120−constructWithReplicateM = constructWithLenM stream list
121− where list = flip replicateM (return 1 :: IO Int)
122− stream = flip S.replicateM (return 1 :: IO Int)
124−constructWithReplicate = constructWithLen stream list
125− where list = flip replicate (1 :: Int)
126− stream = flip S.replicate (1 :: Int)
128−constructWithIntFromThenTo op l =
129− forAll (choose (minBound, maxBound)) $ \from ->
130− forAll (choose (minBound, maxBound)) $ \next ->
131− forAll (choose (minBound, maxBound)) $ \to ->
132− let list len = take len [from,next..to]
133− stream len = S.take len $ S.enumerateFromThenTo from next to
134− in constructWithLen stream list op l
136−#if __GLASGOW_HASKELL__ >= 806
137−-- XXX try very small steps close to 0
138−constructWithDoubleFromThenTo
140− => (t IO Double -> SerialT IO Double)
143−constructWithDoubleFromThenTo op l =
144− forAll (choose (-9007199254740999,9007199254740999)) $ \from ->
145− forAll (choose (-9007199254740999,9007199254740999)) $ \next ->
146− forAll (choose (-9007199254740999,9007199254740999)) $ \to ->
147− let list len = take len [from,next..to]
148− stream len = S.take len $ S.enumerateFromThenTo from next to
149− in constructWithLen stream list op l
152−constructWithIterate ::
153− IsStream t => (t IO Int -> SerialT IO Int) -> Word8 -> Property
154−constructWithIterate op len =
155− withMaxSuccess maxTestCount $
159− (S.toList . op . S.take (fromIntegral len))
160− (S.iterate (+ 1) (0 :: Int))
161− let list = take (fromIntegral len) (iterate (+ 1) 0)
162− listEquals (==) stream list
164−constructWithIterateM ::
165− IsStream t => (t IO Int -> SerialT IO Int) -> Word8 -> Property
166−constructWithIterateM op len =
167− withMaxSuccess maxTestCount $
169− mvl <- run (newIORef [] :: IO (IORef [Int]))
170− let addM mv x y = modifyIORef' mv (++ [y + x]) >> return (y + x)
171− list = take (fromIntegral len) (iterate (+ 1) 0)
174− S.take (fromIntegral len) $
175− S.iterateM (addM mvl 1) (addM mvl 0 0 :: IO Int)
176− streamEffect <- run $ readIORef mvl
177− listEquals (==) streamEffect list
179−constructWithFromIndices ::
180− IsStream t => (t IO Int -> SerialT IO Int) -> Word8 -> Property
181−constructWithFromIndices op len =
182− withMaxSuccess maxTestCount $
185− run $ (S.toList . op . S.take (fromIntegral len)) (S.fromIndices id)
186− let list = take (fromIntegral len) (iterate (+ 1) 0)
187− listEquals (==) stream list
189−constructWithFromIndicesM ::
190− IsStream t => (t IO Int -> SerialT IO Int) -> Word8 -> Property
191−constructWithFromIndicesM op len =
192− withMaxSuccess maxTestCount $
194− mvl <- run (newIORef [] :: IO (IORef [Int]))
195− let addIndex mv i = modifyIORef' mv (++ [i]) >> return i
196− list = take (fromIntegral len) (iterate (+ 1) 0)
199− S.take (fromIntegral len) $ S.fromIndicesM (addIndex mvl)
200− streamEffect <- run $ readIORef mvl
201− listEquals (==) streamEffect list
203-------------------------------------------------------------------------------
32-------------------------------------------------------------------------------
204-- Concurrent generation
33-- Concurrent generation
205-------------------------------------------------------------------------------
34-------------------------------------------------------------------------------
@@ -388,521 +217,6 @@ concurrentFoldrApplication n =
388 (return [])
217 (return [])
389 listEquals (==) stream list
218 listEquals (==) stream list
391−-------------------------------------------------------------------------------
392−-- Transformation operations
393−-------------------------------------------------------------------------------
395−transformCombineFromList
396− :: Semigroup (t IO Int)
397− => ([Int] -> t IO Int)
398− -> ([Int] -> [Int] -> Bool)
400− -> (t IO Int -> SerialT IO Int)
401− -> (t IO Int -> t IO Int)
406−transformCombineFromList constr eq listOp t op a b c =
407− withMaxSuccess maxTestCount $
409− stream <- run ((S.toList . t) $
410− constr a <> op (constr b <> constr c))
411− let list = a <> listOp (b <> c)
412− listEquals eq stream list
414−-- XXX add tests for MonadReader and MonadError etc. In case an SVar is
415−-- accidentally passed through them.
417−-- This tests transform ops along with detecting illegal sharing of SVar across
418−-- conurrent streams. These tests work for all stream types whereas
419−-- transformCombineOpsOrdered work only for ordered stream types i.e. excluding
421−transformCombineOpsCommon
422− :: (IsStream t, Semigroup (t IO Int))
423− => ([Int] -> t IO Int)
425− -> ([Int] -> [Int] -> Bool)
426− -> (t IO Int -> SerialT IO Int)
428−transformCombineOpsCommon constr desc eq t = do
429− let transform = transformCombineFromList constr eq
432− prop (desc <> " filter False") $
433− transform (filter (const False)) t (S.filter (const False))
434− prop (desc <> " filter True") $
435− transform (filter (const True)) t (S.filter (const True))
436− prop (desc <> " filter even") $
437− transform (filter even) t (S.filter even)
439− prop (desc <> " filterM False") $
440− transform (filter (const False)) t (S.filterM (const $ return False))
441− prop (desc <> " filterM True") $
442− transform (filter (const True)) t (S.filterM (const $ return True))
443− prop (desc <> " filterM even") $
444− transform (filter even) t (S.filterM (return . even))
446− prop (desc <> " take maxBound") $
447− transform (take maxBound) t (S.take maxBound)
448− prop (desc <> " take 0") $ transform (take 0) t (S.take 0)
450− prop (desc <> " takeWhile True") $
451− transform (takeWhile (const True)) t (S.takeWhile (const True))
452− prop (desc <> " takeWhile False") $
453− transform (takeWhile (const False)) t (S.takeWhile (const False))
455− prop (desc <> " takeWhileM True") $
456− transform (takeWhile (const True)) t (S.takeWhileM (const $ return True))
457− prop (desc <> " takeWhileM False") $
458− transform (takeWhile (const False)) t (S.takeWhileM (const $ return False))
460− prop (desc <> " drop maxBound") $
461− transform (drop maxBound) t (S.drop maxBound)
462− prop (desc <> " drop 0") $ transform (drop 0) t (S.drop 0)
464− prop (desc <> " dropWhile True") $
465− transform (dropWhile (const True)) t (S.dropWhile (const True))
466− prop (desc <> " dropWhile False") $
467− transform (dropWhile (const False)) t (S.dropWhile (const False))
469− prop (desc <> " dropWhileM True") $
470− transform (dropWhile (const True)) t (S.dropWhileM (const $ return True))
471− prop (desc <> " dropWhileM False") $
472− transform (dropWhile (const False)) t (S.dropWhileM (const $ return False))
474− prop (desc <> " deleteBy (<=) maxBound") $
475− transform (deleteBy (<=) maxBound) t (S.deleteBy (<=) maxBound)
476− prop (desc <> " deleteBy (==) 4") $
477− transform (deleteBy (==) 4) t (S.deleteBy (==) 4)
480− prop (desc <> " mapM (+1)") $
481− transform (fmap (+1)) t (S.mapM (\x -> return (x + 1)))
483− prop (desc <> " scanl'") $ transform (scanl' (flip const) 0) t
484− (S.scanl' (flip const) 0)
485− prop (desc <> " scanlM'") $ transform (scanl' (flip const) 0) t
486− (S.scanlM' (\_ a -> return a) 0)
487− prop (desc <> " scanl") $ transform (scanl' (flip const) 0) t
488− (S.scanl' (flip const) 0)
489− prop (desc <> " scanl1'") $ transform (scanl1 (flip const)) t
490− (S.scanl1' (flip const))
491− prop (desc <> " scanl1M'") $ transform (scanl1 (flip const)) t
492− (S.scanl1M' (\_ a -> return a))
494− let f x = if odd x then Just (x + 100) else Nothing
495− prop (desc <> " mapMaybe") $ transform (mapMaybe f) t (S.mapMaybe f)
498− prop (desc <> " tap FL.sum . map (+1)") $ \a b ->
499− withMaxSuccess maxTestCount $
501− cref <- run $ newIORef 0
502− let sumfoldinref = FL.Fold (\_ e -> modifyIORef' cref (e+))
505− op = S.tap sumfoldinref . S.mapM (\x -> return (x+1))
507− stream <- run ((S.toList . t) $ op (constr a <> constr b))
508− let list = listOp (a <> b)
509− ssum <- run $ readIORef cref
510− assert (sum list == ssum)
511− listEquals eq stream list
514− prop (desc <> " reverse") $ transform reverse t S.reverse
515− -- prop (desc <> " reverse'") $ transform reverse t S.reverse'
518− prop (desc <> " intersperseM") $
519− forAll (choose (minBound, maxBound)) $ \n ->
520− transform (intersperse n) t (S.intersperseM $ return n)
521− prop (desc <> " insertBy 0") $
522− forAll (choose (minBound, maxBound)) $ \n ->
523− transform (insertBy compare n) t (S.insertBy compare n)
526− prop (desc <> " concatMap") $
527− forAll (choose (0, 100)) $ \n ->
528− transform (concatMap (const [1..n]))
529− t (S.concatMap (const (S.fromList [1..n])))
531−toListFL :: Monad m => FL.Fold m a [a]
534−groupSplitOps :: String -> Spec
535−groupSplitOps desc = do
537− -- XXX add tests with multichar separators too
540− prop (desc <> " intercalate . splitOnSeq == id (nil separator)") $
541− forAll listWithZeroes $ \xs -> do
542− withMaxSuccess maxTestCount $
544− ys <- S.toList $ FL.splitOnSeq [] toListFL (S.fromList xs)
545− listEquals (==) (intercalate [] ys) xs
547− prop (desc <> " intercalate . splitOnSeq == id (single element separator)") $
548− forAll listWithZeroes $ \xs -> do
549− withMaxSuccess maxTestCount $
551− ys <- S.toList $ FL.splitOnSeq [0] toListFL (S.fromList xs)
552− listEquals (==) (intercalate [0] ys) xs
554− prop (desc <> " concat . splitOnSeq . intercalate == concat (nil separator/possibly empty list)") $
555− forAll listsWithoutZeroes $ \xss -> do
556− withMaxSuccess maxTestCount $
558− let xs = intercalate [] xss
559− ys <- S.toList $ FL.splitOnSeq [0] toListFL (S.fromList xs)
560− listEquals (==) (concat ys) (concat xss)
562− prop (desc <> " concat . splitOnSeq . intercalate == concat (non-nil separator/possibly empty list)") $
563− forAll listsWithoutZeroes $ \xss -> do
564− withMaxSuccess maxTestCount $
566− let xs = intercalate [0] xss
567− ys <- S.toList $ FL.splitOnSeq [0] toListFL (S.fromList xs)
568− listEquals (==) (concat ys) (concat xss)
570− prop (desc <> " splitOnSeq . intercalate == id (exclusive separator/non-empty list)") $
571− forAll listsWithoutZeroes1 $ \xss -> do
572− withMaxSuccess maxTestCount $
574− let xs = intercalate [0] xss
575− ys <- S.toList $ FL.splitOnSeq [0] toListFL (S.fromList xs)
576− listEquals (==) ys xss
579− prop (desc <> " intercalate [x] . splitOn (== x) == id") $
580− forAll listWithZeroes $ \xs -> do
581− withMaxSuccess maxTestCount $
583− ys <- S.toList $ S.splitOn (== 0) toListFL (S.fromList xs)
584− listEquals (==) (intercalate [0] ys) xs
588− listWithZeroes :: Gen [Int]
589− listWithZeroes = listOf $ frequency [(3, arbitrary), (1, elements [0])]
592− listWithoutZeroes = vectorOf 4 $ suchThat arbitrary (/= 0)
594− listsWithoutZeroes :: Gen [[Int]]
595− listsWithoutZeroes = listOf listWithoutZeroes
597− listsWithoutZeroes1 :: Gen [[Int]]
598− listsWithoutZeroes1 = listOf1 listWithoutZeroes
601−-- transformation tests that can only work reliably for ordered streams i.e.
602−-- Serial, Ahead and Zip. For example if we use "take 1" on an async stream, it
603−-- might yield a different result every time.
604−transformCombineOpsOrdered
605− :: (IsStream t, Semigroup (t IO Int))
606− => ([Int] -> t IO Int)
608− -> ([Int] -> [Int] -> Bool)
609− -> (t IO Int -> SerialT IO Int)
611−transformCombineOpsOrdered constr desc eq t = do
612− let transform = transformCombineFromList constr eq
615− prop (desc <> " take 1") $ transform (take 1) t (S.take 1)
617− prop (desc <> " take 2") $ transform (take 2) t (S.take 2)
618− prop (desc <> " take 3") $ transform (take 3) t (S.take 3)
619− prop (desc <> " take 4") $ transform (take 4) t (S.take 4)
620− prop (desc <> " take 5") $ transform (take 5) t (S.take 5)
622− prop (desc <> " take 10") $ transform (take 10) t (S.take 10)
624− prop (desc <> " takeWhile > 0") $
625− transform (takeWhile (> 0)) t (S.takeWhile (> 0))
627− prop (desc <> " drop 1") $ transform (drop 1) t (S.drop 1)
628− prop (desc <> " drop 10") $ transform (drop 10) t (S.drop 10)
630− prop (desc <> " dropWhile > 0") $
631− transform (dropWhile (> 0)) t (S.dropWhile (> 0))
632− prop (desc <> " scan") $ transform (scanl' (+) 0) t (S.scanl' (+) 0)
634− prop (desc <> " uniq") $ transform referenceUniq t S.uniq
636− prop (desc <> " deleteBy (<=) 0") $
637− transform (deleteBy (<=) 0) t (S.deleteBy (<=) 0)
639− prop (desc <> " findIndices") $
640− transform (findIndices odd) t (S.findIndices odd)
641− prop (desc <> " findIndices . filter") $
642− transform (findIndices odd . filter odd)
644− (S.findIndices odd . S.filter odd)
645− prop (desc <> " elemIndices") $
646− transform (elemIndices 0) t (S.elemIndices 0)
648− -- XXX this does not fail when the SVar is shared, need to fix.
649− prop (desc <> " concurrent application") $
650− transform (& fmap (+1)) t (|& S.map (+1))
652−-------------------------------------------------------------------------------
653−-- Elimination operations
654−-------------------------------------------------------------------------------
663−eliminateOp constr listOp op a =
665− stream <- run $ op (constr a)
667− equals (==) stream list
669−wrapMaybe :: ([a1] -> a2) -> [a1] -> Maybe a2
670−wrapMaybe f x = if null x then Nothing else Just (f x)
672−wrapOutOfBounds :: ([a1] -> Int -> a2) -> Int -> [a1] -> Maybe a2
673−wrapOutOfBounds f i x | null x = Nothing
674− | i >= length x = Nothing
675− | otherwise = Just (f x i)
677−wrapThe :: Eq a => [a] -> Maybe a
679− | all (x ==) xs = Just x
680− | otherwise = Nothing
683−-- This is the reference uniq implementation to compare uniq against,
684−-- we can use uniq from vector package, but for now this should
686−referenceUniq :: Eq a => [a] -> [a]
692− | x == y = go (x : xs)
693− | otherwise = x : go (y : xs)
696− :: ([Int] -> t IO Int)
698− -> (t IO Int -> SerialT IO Int)
700−eliminationOps constr desc t = do
702− prop (desc <> " null") $ eliminateOp constr null $ S.null . t
703− prop (desc <> " foldl'") $
704− eliminateOp constr (foldl' (+) 0) $ S.foldl' (+) 0 . t
705− prop (desc <> " foldl1'") $
706− eliminateOp constr (wrapMaybe $ foldl1' (+)) $ S.foldl1' (+) . t
708− prop (desc <> " foldr1") $
709− eliminateOp constr (wrapMaybe $ foldr1 (+)) $ S.foldr1 (+) . t
711− prop (desc <> " all") $ eliminateOp constr (all even) $ S.all even . t
712− prop (desc <> " any") $ eliminateOp constr (any even) $ S.any even . t
713− prop (desc <> " and") $ eliminateOp constr (and . fmap (> 0)) $
714− (S.and . S.map (> 0)) . t
715− prop (desc <> " or") $ eliminateOp constr (or . fmap (> 0)) $
716− (S.or . S.map (> 0)) . t
717− prop (desc <> " length") $ eliminateOp constr length $ S.length . t
718− prop (desc <> " sum") $ eliminateOp constr sum $ S.sum . t
719− prop (desc <> " product") $ eliminateOp constr product $ S.product . t
721− prop (desc <> " maximum") $
722− eliminateOp constr (wrapMaybe maximum) $ S.maximum . t
723− prop (desc <> " minimum") $
724− eliminateOp constr (wrapMaybe minimum) $ S.minimum . t
726− prop (desc <> " maximumBy compare") $
727− eliminateOp constr (wrapMaybe $ maximumBy compare) $
728− S.maximumBy compare . t
729− prop (desc <> " maximumBy flip compare") $
730− eliminateOp constr (wrapMaybe $ maximumBy $ flip compare) $
731− S.maximumBy (flip compare) . t
732− prop (desc <> " minimumBy compare") $
733− eliminateOp constr (wrapMaybe $ minimumBy compare) $
734− S.minimumBy compare . t
735− prop (desc <> " minimumBy flip compare") $
736− eliminateOp constr (wrapMaybe $ minimumBy $ flip compare) $
737− S.minimumBy (flip compare) . t
739− prop (desc <> " findIndex") $
740− eliminateOp constr (findIndex odd) $ S.findIndex odd . t
741− prop (desc <> " elemIndex") $
742− eliminateOp constr (elemIndex 3) $ S.elemIndex 3 . t
744− prop (desc <> " !! 5") $
745− eliminateOp constr (wrapOutOfBounds (!!) 5) $ (S.!! 5) . t
746− prop (desc <> " !! 4") $
747− eliminateOp constr (wrapOutOfBounds (!!) 0) $ (S.!! 0) . t
749− prop (desc <> " find") $ eliminateOp constr (find even) $ S.find even . t
750− prop (desc <> " lookup") $
751− eliminateOp constr (lookup 3 . flip zip [1..]) $
752− S.lookup 3 . S.zipWith (\a b -> (b, a)) (S.fromList [(1::Int)..]) . t
753− prop (desc <> " the") $ eliminateOp constr wrapThe $ S.the . t
755− -- Multi-stream eliminations
757− -- XXX Write better tests for substreams.
758− prop (desc <> " isPrefixOf 10") $ eliminateOp constr (isPrefixOf [1..10]) $
759− S.isPrefixOf (S.fromList [(1::Int)..10]) . t
760− prop (desc <> " isSubsequenceOf 10") $
761− eliminateOp constr (isSubsequenceOf $ filter even [1..10]) $
762− S.isSubsequenceOf (S.fromList $ filter even [(1::Int)..10]) . t
763− prop (desc <> " stripPrefix 10") $ eliminateOp constr (stripPrefix [1..10]) $
764− (\s -> s >>= maybe (return Nothing) (fmap Just . S.toList)) .
765− S.stripPrefix (S.fromList [(1::Int)..10]) . t
767−-- head/tail/last may depend on the order in case of parallel streams
768−-- so we test these only for serial streams.
769−eliminationOpsOrdered
770− :: ([Int] -> t IO Int)
772− -> (t IO Int -> SerialT IO Int)
774−eliminationOpsOrdered constr desc t = do
775− prop (desc <> " head") $ eliminateOp constr (wrapMaybe head) $ S.head . t
776− prop (desc <> " tail") $ eliminateOp constr (wrapMaybe tail) $ \x -> do
779− Nothing -> return Nothing
780− Just s -> Just <$> S.toList s
781− prop (desc <> " last") $ eliminateOp constr (wrapMaybe last) $ S.last . t
782− prop (desc <> " init") $ eliminateOp constr (wrapMaybe init) $ \x -> do
785− Nothing -> return Nothing
786− Just s -> Just <$> S.toList s
789− :: ([Word8] -> t IO Word8)
790− -> (t IO Word8 -> SerialT IO Word8)
791− -> (Word8 -> SerialT IO Word8 -> IO Bool)
792− -> (Word8 -> [Word8] -> Bool)
795−elemOp constr op streamOp listOp (x, xs) =
797− stream <- run $ (streamOp x . op) (constr xs)
798− let list = listOp x xs
799− equals (==) stream list
802− :: ([Word8] -> t IO Word8)
804− -> (t IO Word8 -> SerialT IO Word8)
806−eliminationOpsWord8 constr desc t = do
807− prop (desc <> " elem") $ elemOp constr t S.elem elem
808− prop (desc <> " notElem") $ elemOp constr t S.notElem notElem
810−-------------------------------------------------------------------------------
811−-- Semigroup operations
812−-------------------------------------------------------------------------------
815− :: (Eq b, Show b) =>
817− -> ([b] -> [b] -> Bool)
819− -> (t IO a -> SerialT IO b)
822−transformFromList constr eq listOp op a =
824− stream <- run ((S.toList . op) (constr a))
826− listEquals eq stream list
829− :: ([Int] -> t IO Int)
830− -> (t IO Int -> SerialT IO Int)
831− -> ([Int] -> [Int] -> Bool)
834−foldFromList constr op eq = transformFromList constr eq id op
836−-- XXX concatenate streams of multiple elements rather than single elements
840−#if __GLASGOW_HASKELL__ < 804
841− , Semigroup (t IO Int)
843− , Monoid (t IO Int))
845− -> ([Int] -> [Int] -> Bool)
846− -> (t IO Int -> SerialT IO Int)
848−semigroupOps desc eq t = do
849− prop (desc <> " <>") $ foldFromList (S.foldMapWith (<>) singleton) t eq
850− prop (desc <> " mappend") $ foldFromList (S.foldMapWith mappend singleton) t eq
852−-------------------------------------------------------------------------------
853−-- Functor operations
854−-------------------------------------------------------------------------------
858− => ([Int] -> t IO Int)
860− -> ([Int] -> [Int] -> Bool)
861− -> (t IO Int -> SerialT IO Int)
863−functorOps constr desc eq t = do
864− prop (desc <> " id") $ transformFromList constr eq id t
865− prop (desc <> " fmap (+1)") $ transformFromList constr eq (fmap (+1)) $ t . fmap (+1)
867−-------------------------------------------------------------------------------
868−-- Applicative operations
869−-------------------------------------------------------------------------------
872− :: Applicative (t IO)
873− => ([Int] -> t IO Int)
874− -> ([(Int, Int)] -> [(Int, Int)] -> Bool)
875− -> (t IO (Int, Int) -> SerialT IO (Int, Int))
878−applicativeOps constr eq t (a, b) = withMaxSuccess maxTestCount $
880− stream <- run ((S.toList . t) ((,) <$> constr a <*> constr b))
881− let list = (,) <$> a <*> b
882− listEquals eq stream list
884− stream1 <- run ((S.toList . t) (liftA2 (,) (constr a) (constr b)))
885− listEquals eq stream1 list
887−-- XXX we can combine this with applicativeOps by making the type sufficiently
890− :: Applicative (t IO)
891− => ([Int] -> t IO Int)
892− -> ([Int] -> [Int] -> Bool)
893− -> (t IO Int -> SerialT IO Int)
896−applicativeOps1 constr eq t (a, b) = withMaxSuccess maxTestCount $
898− stream <- run ((S.toList . t) (constr a *> constr b))
900− listEquals eq stream list
902− stream1 <- run ((S.toList . t) (constr a <* constr b))
904− listEquals eq stream1 list1
906-------------------------------------------------------------------------------
220-------------------------------------------------------------------------------
907-- Zip operations
221-- Zip operations
908-------------------------------------------------------------------------------
222-------------------------------------------------------------------------------
@@ -924,22 +238,6 @@ zipApplicative constr eq t (a, b) = withMaxSuccess maxTestCount $
924 listEquals eq stream2 list
238 listEquals eq stream2 list
925 listEquals eq stream3 list
239 listEquals eq stream3 list
929− => ([Int] -> t IO Int)
930− -> ([(Int, Int)] -> [(Int, Int)] -> Bool)
931− -> (t IO (Int, Int) -> SerialT IO (Int, Int))
934−zipMonadic constr eq t (a, b) = withMaxSuccess maxTestCount $
939− (S.zipWithM (curry return) (constr a) (constr b)))
940− let list = getZipList $ (,) <$> ZipList a <*> ZipList b
941− listEquals eq stream1 list
943zipAsyncMonadic
241zipAsyncMonadic
944 :: IsStream t
242 :: IsStream t
945 => ([Int] -> t IO Int)
243 => ([Int] -> t IO Int)
@@ -961,88 +259,10 @@ zipAsyncMonadic constr eq t (a, b) = withMaxSuccess maxTestCount $
961 listEquals eq stream1 list
259 listEquals eq stream1 list
962 listEquals eq stream2 list
260 listEquals eq stream2 list
964−-------------------------------------------------------------------------------
966−-------------------------------------------------------------------------------
970− => ([Int] -> t IO Int)
971− -> ([Int] -> [Int] -> Bool)
972− -> (t IO Int -> SerialT IO Int)
975−monadThen constr eq t (a, b) = withMaxSuccess maxTestCount $ monadicIO $ do
976− stream <- run ((S.toList . t) (constr a >> constr b))
978− listEquals eq stream list
982− => ([Int] -> t IO Int)
983− -> ([Int] -> [Int] -> Bool)
984− -> (t IO Int -> SerialT IO Int)
987−monadBind constr eq t (a, b) = withMaxSuccess maxTestCount $
992− (constr a >>= \x -> (+ x) <$> constr b))
993− let list = a >>= \x -> (+ x) <$> b
994− listEquals eq stream list
996-------------------------------------------------------------------------------
262-------------------------------------------------------------------------------
997-- Tests for S.groupsBy
263-- Tests for S.groupsBy
998-------------------------------------------------------------------------------
264-------------------------------------------------------------------------------
1001−-- If the list is empty, returns Nothing,
1002−-- else wraps the minimum value of the list in Just.
1003−maybeMinimum :: [Int] -> Maybe Int
1004−maybeMinimum [] = Nothing
1005−maybeMinimum ls = Just $ minimum ls
1009−-- After grouping (and folding) Int stream using @>@ operation,
1010−-- the first @Int@ of every @[Int]@ in the @[Int]@ stream should be the minimum.
1011−testGroupsBy :: Property
1013− forAll (choose (0, maxStreamLen)) $ \len ->
1014− forAll (vectorOf len (arbitrary :: Gen Int)) $ \vec -> monadicIO $ do
1015− r <- run $ S.all (\ls ->
1018− (x:_) -> x == minimum ls)
1019− $ S.groupsBy (>) FL.toList
1024−-- Checks if the @[Int]@ is non-increasing.
1025−decreasing :: [Maybe Int] -> Bool
1026−decreasing [] = True
1027−decreasing xs = all (== True) $ zipWith (<=) (tail xs) xs
1031−-- To check if the minimum elements (after grouping on @>@)
1032−-- are non-increasing (either decrease or remain the same).
1033−-- Had an element been strictly greater, it would have been grouped
1034−-- with that element only.
1035−testGroupsBySep :: Property
1037− forAll (choose (0, maxStreamLen)) $ \len ->
1038− forAll (vectorOf len (arbitrary :: Gen Int)) $ \vec -> monadicIO $ do
1039− a <- run $ S.toList
1040− $ S.map maybeMinimum
1041− $ S.groupsBy (>) FL.toList
1043− assert $ decreasing a == True
1046main :: IO ()
266main :: IO ()
1047main = hspec
267main = hspec
1048 $ H.parallel
268 $ H.parallel
@@ -1145,26 +365,12 @@ main = hspec
1145 zipAsyncOps spec = mapOps spec $ makeOps zipAsyncly
365 zipAsyncOps spec = mapOps spec $ makeOps zipAsyncly
1147 describe "Construction" $ do
367 describe "Construction" $ do
1148− serialOps $ prop "serially replicate" . constructWithReplicate
1150− serialOps $ prop "serially replicateM" . constructWithReplicateM
1151 wSerialOps $ prop "wSerially replicateM" . constructWithReplicateM
368 wSerialOps $ prop "wSerially replicateM" . constructWithReplicateM
1152 aheadOps $ prop "aheadly replicateM" . constructWithReplicateM
369 aheadOps $ prop "aheadly replicateM" . constructWithReplicateM
1153 asyncOps $ prop "asyncly replicateM" . constructWithReplicateM
370 asyncOps $ prop "asyncly replicateM" . constructWithReplicateM
1154 wAsyncOps $ prop "wAsyncly replicateM" . constructWithReplicateM
371 wAsyncOps $ prop "wAsyncly replicateM" . constructWithReplicateM
1155 parallelOps $ prop "parallely replicateM" . constructWithReplicateM
372 parallelOps $ prop "parallely replicateM" . constructWithReplicateM
1157− serialOps $ prop "serially intFromThenTo" .
1158− constructWithIntFromThenTo
1159−#if __GLASGOW_HASKELL__ >= 806
1160− serialOps $ prop "serially DoubleFromThenTo" .
1161− constructWithDoubleFromThenTo
1164− serialOps $ prop "serially iterate" . constructWithIterate
1166− -- XXX test for all types of streams
1167− serialOps $ prop "serially iterateM" . constructWithIterateM
1168 -- take doesn't work well on concurrent streams. Even though it
374 -- take doesn't work well on concurrent streams. Even though it
1169 -- seems like take only has a problem when used with parallely.
375 -- seems like take only has a problem when used with parallely.
1170 -- wSerialOps $ prop "wSerially iterateM" wSerially . constructWithIterate
376 -- wSerialOps $ prop "wSerially iterateM" wSerially . constructWithIterate
@@ -1174,13 +380,7 @@ main = hspec
1174 -- parallelOps $ prop "parallely iterateM" parallely . onstructWithIterate
380 -- parallelOps $ prop "parallely iterateM" parallely . onstructWithIterate
1175 -- XXX add tests for fromIndices
381 -- XXX add tests for fromIndices
1177− serialOps $ prop "serially fromIndices" . constructWithFromIndices
1179− serialOps $ prop "serially fromIndicesM" . constructWithFromIndicesM
1181 describe "Functor operations" $ do
383 describe "Functor operations" $ do
1182− serialOps $ functorOps S.fromFoldable "serially" (==)
1183− serialOps $ functorOps folded "serially folded" (==)
1184 wSerialOps $ functorOps S.fromFoldable "wSerially" (==)
384 wSerialOps $ functorOps S.fromFoldable "wSerially" (==)
1185 wSerialOps $ functorOps folded "wSerially folded" (==)
385 wSerialOps $ functorOps folded "wSerially folded" (==)
1186 aheadOps $ functorOps S.fromFoldable "aheadly" (==)
386 aheadOps $ functorOps S.fromFoldable "aheadly" (==)
@@ -1197,7 +397,6 @@ main = hspec
1197 zipAsyncOps $ functorOps folded "zipAsyncly folded" (==)
397 zipAsyncOps $ functorOps folded "zipAsyncly folded" (==)
1199 describe "Semigroup operations" $ do
399 describe "Semigroup operations" $ do
1200− serialOps $ semigroupOps "serially" (==)
1201 wSerialOps $ semigroupOps "wSerially" (==)
400 wSerialOps $ semigroupOps "wSerially" (==)
1202 aheadOps $ semigroupOps "aheadly" (==)
401 aheadOps $ semigroupOps "aheadly" (==)
1203 asyncOps $ semigroupOps "asyncly" sortEq
402 asyncOps $ semigroupOps "asyncly" sortEq
@@ -1207,12 +406,6 @@ main = hspec
1207 zipAsyncOps $ semigroupOps "zipAsyncly" (==)
406 zipAsyncOps $ semigroupOps "zipAsyncly" (==)
1209 describe "Applicative operations" $ do
408 describe "Applicative operations" $ do
1210− -- The tests using sorted equality are weaker tests
1211− -- We need to have stronger unit tests for all those
1212− -- XXX applicative with three arguments
1213− serialOps $ prop "serially applicative" . applicativeOps S.fromFoldable (==)
1214− serialOps $ prop "serially applicative folded" . applicativeOps folded (==)
1215− serialOps $ prop "serially applicative discard" . applicativeOps1 S.fromFoldable (==)
1216 wSerialOps $ prop "wSerially applicative" . applicativeOps S.fromFoldable sortEq
409 wSerialOps $ prop "wSerially applicative" . applicativeOps S.fromFoldable sortEq
1217 wSerialOps $ prop "wSerially applicative folded" . applicativeOps folded sortEq
410 wSerialOps $ prop "wSerially applicative folded" . applicativeOps folded sortEq
1218 aheadOps $ prop "aheadly applicative" . applicativeOps S.fromFoldable (==)
411 aheadOps $ prop "aheadly applicative" . applicativeOps S.fromFoldable (==)
@@ -1233,8 +426,6 @@ main = hspec
1233 -- We test only the serial zip with serial streams and the parallel
426 -- We test only the serial zip with serial streams and the parallel
1234 -- stream, because the rate setting in these streams can slow down
427 -- stream, because the rate setting in these streams can slow down
1235 -- zipAsync.
428 -- zipAsync.
1236− serialOps $ prop "zip monadic serially" . zipMonadic S.fromFoldable (==)
1237− serialOps $ prop "zip monadic serially folded" . zipMonadic folded (==)
1238 wSerialOps $ prop "zip monadic wSerially" . zipMonadic S.fromFoldable (==)
429 wSerialOps $ prop "zip monadic wSerially" . zipMonadic S.fromFoldable (==)
1239 wSerialOps $ prop "zip monadic wSerially folded" . zipMonadic folded (==)
430 wSerialOps $ prop "zip monadic wSerially folded" . zipMonadic folded (==)
1240 aheadOps $ prop "zip monadic aheadly" . zipAsyncMonadic S.fromFoldable (==)
431 aheadOps $ prop "zip monadic aheadly" . zipAsyncMonadic S.fromFoldable (==)
@@ -1252,28 +443,24 @@ main = hspec
1252 -- describe "Merge operations" $ do
443 -- describe "Merge operations" $ do
1254 describe "Monad operations" $ do
445 describe "Monad operations" $ do
1255− serialOps $ prop "serially monad then" . monadThen S.fromFoldable (==)
1256 wSerialOps $ prop "wSerially monad then" . monadThen S.fromFoldable sortEq
446 wSerialOps $ prop "wSerially monad then" . monadThen S.fromFoldable sortEq
1257 aheadOps $ prop "aheadly monad then" . monadThen S.fromFoldable (==)
447 aheadOps $ prop "aheadly monad then" . monadThen S.fromFoldable (==)
1258 asyncOps $ prop "asyncly monad then" . monadThen S.fromFoldable sortEq
448 asyncOps $ prop "asyncly monad then" . monadThen S.fromFoldable sortEq
1259 wAsyncOps $ prop "wAsyncly monad then" . monadThen S.fromFoldable sortEq
449 wAsyncOps $ prop "wAsyncly monad then" . monadThen S.fromFoldable sortEq
1260 parallelOps $ prop "parallely monad then" . monadThen S.fromFoldable sortEq
450 parallelOps $ prop "parallely monad then" . monadThen S.fromFoldable sortEq
1262− serialOps $ prop "serially monad then folded" . monadThen folded (==)
1263 wSerialOps $ prop "wSerially monad then folded" . monadThen folded sortEq
452 wSerialOps $ prop "wSerially monad then folded" . monadThen folded sortEq
1264 aheadOps $ prop "aheadly monad then folded" . monadThen folded (==)
453 aheadOps $ prop "aheadly monad then folded" . monadThen folded (==)
1265 asyncOps $ prop "asyncly monad then folded" . monadThen folded sortEq
454 asyncOps $ prop "asyncly monad then folded" . monadThen folded sortEq
1266 wAsyncOps $ prop "wAsyncly monad then folded" . monadThen folded sortEq
455 wAsyncOps $ prop "wAsyncly monad then folded" . monadThen folded sortEq
1267 parallelOps $ prop "parallely monad then folded" . monadThen folded sortEq
456 parallelOps $ prop "parallely monad then folded" . monadThen folded sortEq
1269− serialOps $ prop "serially monad bind" . monadBind S.fromFoldable (==)
1270 wSerialOps $ prop "wSerially monad bind" . monadBind S.fromFoldable sortEq
458 wSerialOps $ prop "wSerially monad bind" . monadBind S.fromFoldable sortEq
1271 aheadOps $ prop "aheadly monad bind" . monadBind S.fromFoldable (==)
459 aheadOps $ prop "aheadly monad bind" . monadBind S.fromFoldable (==)
1272 asyncOps $ prop "asyncly monad bind" . monadBind S.fromFoldable sortEq
460 asyncOps $ prop "asyncly monad bind" . monadBind S.fromFoldable sortEq
1273 wAsyncOps $ prop "wAsyncly monad bind" . monadBind S.fromFoldable sortEq
461 wAsyncOps $ prop "wAsyncly monad bind" . monadBind S.fromFoldable sortEq
1274 parallelOps $ prop "parallely monad bind" . monadBind S.fromFoldable sortEq
462 parallelOps $ prop "parallely monad bind" . monadBind S.fromFoldable sortEq
1276− serialOps $ prop "serially monad bind folded" . monadBind folded (==)
1277 wSerialOps $ prop "wSerially monad bind folded" . monadBind folded sortEq
464 wSerialOps $ prop "wSerially monad bind folded" . monadBind folded sortEq
1278 aheadOps $ prop "aheadly monad bind folded" . monadBind folded (==)
465 aheadOps $ prop "aheadly monad bind folded" . monadBind folded (==)
1279 asyncOps $ prop "asyncly monad bind folded" . monadBind folded sortEq
466 asyncOps $ prop "asyncly monad bind folded" . monadBind folded sortEq
@@ -1318,7 +505,6 @@ main = hspec
1318 concurrentFoldlApplication
505 concurrentFoldlApplication
1320 describe "Stream transform and combine operations" $ do
507 describe "Stream transform and combine operations" $ do
1321− serialOps $ transformCombineOpsCommon S.fromFoldable "serially" (==)
1322 wSerialOps $ transformCombineOpsCommon S.fromFoldable "wSerially" sortEq
508 wSerialOps $ transformCombineOpsCommon S.fromFoldable "wSerially" sortEq
1323 aheadOps $ transformCombineOpsCommon S.fromFoldable "aheadly" (==)
509 aheadOps $ transformCombineOpsCommon S.fromFoldable "aheadly" (==)
1324 asyncOps $ transformCombineOpsCommon S.fromFoldable "asyncly" sortEq
510 asyncOps $ transformCombineOpsCommon S.fromFoldable "asyncly" sortEq
@@ -1327,7 +513,6 @@ main = hspec
1327 zipSerialOps $ transformCombineOpsCommon S.fromFoldable "zipSerially" (==)
513 zipSerialOps $ transformCombineOpsCommon S.fromFoldable "zipSerially" (==)
1328 zipAsyncOps $ transformCombineOpsCommon S.fromFoldable "zipAsyncly" (==)
514 zipAsyncOps $ transformCombineOpsCommon S.fromFoldable "zipAsyncly" (==)
1330− serialOps $ transformCombineOpsCommon folded "serially" (==)
1331 wSerialOps $ transformCombineOpsCommon folded "wSerially" sortEq
516 wSerialOps $ transformCombineOpsCommon folded "wSerially" sortEq
1332 aheadOps $ transformCombineOpsCommon folded "aheadly" (==)
517 aheadOps $ transformCombineOpsCommon folded "aheadly" (==)
1333 asyncOps $ transformCombineOpsCommon folded "asyncly" sortEq
518 asyncOps $ transformCombineOpsCommon folded "asyncly" sortEq
@@ -1336,21 +521,15 @@ main = hspec
1336 zipSerialOps $ transformCombineOpsCommon folded "zipSerially" (==)
521 zipSerialOps $ transformCombineOpsCommon folded "zipSerially" (==)
1337 zipAsyncOps $ transformCombineOpsCommon folded "zipAsyncly" (==)
522 zipAsyncOps $ transformCombineOpsCommon folded "zipAsyncly" (==)
1339− serialOps $ transformCombineOpsOrdered S.fromFoldable "serially" (==)
1340 aheadOps $ transformCombineOpsOrdered S.fromFoldable "aheadly" (==)
524 aheadOps $ transformCombineOpsOrdered S.fromFoldable "aheadly" (==)
1341 zipSerialOps $ transformCombineOpsOrdered S.fromFoldable "zipSerially" (==)
525 zipSerialOps $ transformCombineOpsOrdered S.fromFoldable "zipSerially" (==)
1342 zipAsyncOps $ transformCombineOpsOrdered S.fromFoldable "zipAsyncly" (==)
526 zipAsyncOps $ transformCombineOpsOrdered S.fromFoldable "zipAsyncly" (==)
1344− serialOps $ transformCombineOpsOrdered folded "serially" (==)
1345 aheadOps $ transformCombineOpsOrdered folded "aheadly" (==)
528 aheadOps $ transformCombineOpsOrdered folded "aheadly" (==)
1346 zipSerialOps $ transformCombineOpsOrdered folded "zipSerially" (==)
529 zipSerialOps $ transformCombineOpsOrdered folded "zipSerially" (==)
1347 zipAsyncOps $ transformCombineOpsOrdered folded "zipAsyncly" (==)
530 zipAsyncOps $ transformCombineOpsOrdered folded "zipAsyncly" (==)
1349− describe "Stream group and split operations" $ do
1350− groupSplitOps "serially"
1352 describe "Stream elimination operations" $ do
532 describe "Stream elimination operations" $ do
1353− serialOps $ eliminationOps S.fromFoldable "serially"
1354 wSerialOps $ eliminationOps S.fromFoldable "wSerially"
533 wSerialOps $ eliminationOps S.fromFoldable "wSerially"
1355 aheadOps $ eliminationOps S.fromFoldable "aheadly"
534 aheadOps $ eliminationOps S.fromFoldable "aheadly"
1356 asyncOps $ eliminationOps S.fromFoldable "asyncly"
535 asyncOps $ eliminationOps S.fromFoldable "asyncly"
@@ -1359,7 +538,6 @@ main = hspec
1359 zipSerialOps $ eliminationOps S.fromFoldable "zipSerially"
538 zipSerialOps $ eliminationOps S.fromFoldable "zipSerially"
1360 zipAsyncOps $ eliminationOps S.fromFoldable "zipAsyncly"
539 zipAsyncOps $ eliminationOps S.fromFoldable "zipAsyncly"
1362− serialOps $ eliminationOps folded "serially folded"
1363 wSerialOps $ eliminationOps folded "wSerially folded"
541 wSerialOps $ eliminationOps folded "wSerially folded"
1364 aheadOps $ eliminationOps folded "aheadly folded"
542 aheadOps $ eliminationOps folded "aheadly folded"
1365 asyncOps $ eliminationOps folded "asyncly folded"
543 asyncOps $ eliminationOps folded "asyncly folded"
@@ -1368,7 +546,6 @@ main = hspec
1368 zipSerialOps $ eliminationOps folded "zipSerially folded"
546 zipSerialOps $ eliminationOps folded "zipSerially folded"
1369 zipAsyncOps $ eliminationOps folded "zipAsyncly folded"
547 zipAsyncOps $ eliminationOps folded "zipAsyncly folded"
1371− serialOps $ eliminationOpsWord8 S.fromFoldable "serially"
1372 wSerialOps $ eliminationOpsWord8 S.fromFoldable "wSerially"
549 wSerialOps $ eliminationOpsWord8 S.fromFoldable "wSerially"
1373 aheadOps $ eliminationOpsWord8 S.fromFoldable "aheadly"
550 aheadOps $ eliminationOpsWord8 S.fromFoldable "aheadly"
1374 asyncOps $ eliminationOpsWord8 S.fromFoldable "asyncly"
551 asyncOps $ eliminationOpsWord8 S.fromFoldable "asyncly"
@@ -1377,7 +554,6 @@ main = hspec
1377 zipSerialOps $ eliminationOpsWord8 S.fromFoldable "zipSerially"
554 zipSerialOps $ eliminationOpsWord8 S.fromFoldable "zipSerially"
1378 zipAsyncOps $ eliminationOpsWord8 S.fromFoldable "zipAsyncly"
555 zipAsyncOps $ eliminationOpsWord8 S.fromFoldable "zipAsyncly"
1380− serialOps $ eliminationOpsWord8 folded "serially folded"
1381 wSerialOps $ eliminationOpsWord8 folded "wSerially folded"
557 wSerialOps $ eliminationOpsWord8 folded "wSerially folded"
1382 aheadOps $ eliminationOpsWord8 folded "aheadly folded"
558 aheadOps $ eliminationOpsWord8 folded "aheadly folded"
1383 asyncOps $ eliminationOpsWord8 folded "asyncly folded"
559 asyncOps $ eliminationOpsWord8 folded "asyncly folded"
@@ -1389,18 +565,12 @@ main = hspec
1389 -- XXX Add a test where we chain all transformation APIs and make sure that
565 -- XXX Add a test where we chain all transformation APIs and make sure that
1390 -- the state is being passed through all of them.
566 -- the state is being passed through all of them.
1391 describe "Stream serial elimination operations" $ do
567 describe "Stream serial elimination operations" $ do
1392− serialOps $ eliminationOpsOrdered S.fromFoldable "serially"
1393 wSerialOps $ eliminationOpsOrdered S.fromFoldable "wSerially"
568 wSerialOps $ eliminationOpsOrdered S.fromFoldable "wSerially"
1394 aheadOps $ eliminationOpsOrdered S.fromFoldable "aheadly"
569 aheadOps $ eliminationOpsOrdered S.fromFoldable "aheadly"
1395 zipSerialOps $ eliminationOpsOrdered S.fromFoldable "zipSerially"
570 zipSerialOps $ eliminationOpsOrdered S.fromFoldable "zipSerially"
1396 zipAsyncOps $ eliminationOpsOrdered S.fromFoldable "zipAsyncly"
571 zipAsyncOps $ eliminationOpsOrdered S.fromFoldable "zipAsyncly"
1398− serialOps $ eliminationOpsOrdered folded "serially folded"
1399 wSerialOps $ eliminationOpsOrdered folded "wSerially folded"
573 wSerialOps $ eliminationOpsOrdered folded "wSerially folded"
1400 aheadOps $ eliminationOpsOrdered folded "aheadly folded"
574 aheadOps $ eliminationOpsOrdered folded "aheadly folded"
1401 zipSerialOps $ eliminationOpsOrdered folded "zipSerially folded"
575 zipSerialOps $ eliminationOpsOrdered folded "zipSerially folded"
1402 zipAsyncOps $ eliminationOpsOrdered folded "zipAsyncly folded"
576 zipAsyncOps $ eliminationOpsOrdered folded "zipAsyncly folded"
1404− describe "Tests for S.groupsBy" $ do
1405− prop "testGroupsBy" testGroupsBy
1406− prop "testGroupsBySep" testGroupsBySep