on a11fe00 help sign in
33 lines 842 B history raw
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
9module Streamly.Test.Data.Stream (main) where
11import qualified Streamly.Data.Fold as Fold
12import qualified Streamly.Data.Stream as Stream
14import Test.Hspec.QuickCheck
15import Test.Hspec as H
17moduleName :: String
18moduleName = "Data.Stream"
20testgroupsOf :: Expectation
21testgroupsOf =
22 Stream.toList
23 (Stream.groupsOf 2 Fold.sum (Stream.enumerateFromTo 1 10))
24 `shouldReturn` [3::Int, 7, 11, 15, 19]
26main :: IO ()
27main =
28 hspec $
29 H.parallel $
30 modifyMaxSuccess (const 1) $ do
31 describe moduleName $ do
32 describe "Repeated Fold" $ do
33 prop "testgroupsOf" testgroupsOf