@@ -0,0 +1,33 @@
1+-- |
2+-- Module : Streamly.Test.Data.Stream
3+-- Copyright : (c) 2019 Composewell technologies
4+-- License : BSD-3-Clause
5+-- Maintainer : streamly@composewell.com
6+-- Stability : experimental
7+-- Portability : GHC
8+
9+module Streamly.Test.Data.Stream (main) where
10+
11+import qualified Streamly.Data.Fold as Fold
12+import qualified Streamly.Data.Stream as Stream
13+
14+import Test.Hspec.QuickCheck
15+import Test.Hspec as H
16+
17+moduleName :: String
18+moduleName = "Data.Stream"
19+
20+testgroupsOf :: Expectation
21+testgroupsOf =
22+ Stream.toList
23+ (Stream.groupsOf 2 Fold.sum (Stream.enumerateFromTo 1 10))
24+ `shouldReturn` [3::Int, 7, 11, 15, 19]
25+
26+main :: IO ()
27+main =
28+ hspec $
29+ H.parallel $
30+ modifyMaxSuccess (const 1) $ do
31+ describe moduleName $ do
32+ describe "Repeated Fold" $ do
33+ prop "testgroupsOf" testgroupsOf