1module Main (main) where
3import qualified Streamly.Prelude as S
4import Streamly.Internal.Data.Fold
6import Test.Hspec.QuickCheck
7import Test.QuickCheck (Property, forAll, Gen, vectorOf, arbitrary, choose)
8import Test.QuickCheck.Monadic (monadicIO, assert, run)
15testRollingHashFirstN :: Property
16testRollingHashFirstN =
17 forAll (choose (0, maxStreamLen)) $ \len ->
18 forAll (choose (0, len)) $ \n ->
19 forAll (vectorOf len (arbitrary :: Gen Int)) $ \vec -> monadicIO $ do
20 a <- run $ S.fold rollingHash $ S.take n $ S.fromList vec
21 b <- run $ S.fold (rollingHashFirstN n) $ S.fromList vec
26 describe "Rolling Hash Folds" $
27 prop "testRollingHashFirstN" testRollingHashFirstN
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list