@@ -4,6 +4,7 @@
44module Main (main) where
55
66import Control.Concurrent (threadDelay)
7+import Control.Monad (replicateM)
78import Data.Foldable (forM_)
89import Data.List (sort)
910import Test.Hspec
@@ -637,6 +638,14 @@ mixedOps = do
637638streamOperations :: Streaming t => (t IO Int, [Int], Int) -> Spec
638639streamOperations (stream, list, len) = do
639640
641+ -- Generation
642+ it "replicateM" $ do
643+ let x = return (1 :: Int)
644+ str <- A.toList . serially $ A.replicateM len x
645+ lst <- replicateM len x
646+ return $ str == lst
647+ `shouldReturn` True
648+
640649 -- Filtering
641650 it "filter all out" $ transform (A.filter (> len)) (filter (> len))
642651 it "filter all in" $ transform (A.filter (<= len)) (filter (<= len))