on master help sign in
Fix tests under dev flag.
commit10b03bf59fa818566d57b8fd292fcfb9f7651ef0 authorPranay Sashank <pranaysashank@composewell.com> dateMon 5 Apr 2021, 19:04 (6 years ago) parent9fc2c7e
4 files changed+13−12
test/Streamly/Test/Prelude/Rate.hs+1−1 test/Streamly/Test/Prelude/Serial.hs+9−9 test/lib/Streamly/Test/Prelude/Common.hs+2−2 test/streamly-tests.cabal+1
test/Streamly/Test/Prelude/Rate.hs+1−1
@@ -7,7 +7,7 @@
77-- Stability : experimental
88-- Portability : GHC
99
10−module Streamly.Test.Prelude.MaxRate where
10+module Streamly.Test.Prelude.Rate where
1111
1212import qualified Streamly.Prelude as S
1313
test/Streamly/Test/Prelude/Serial.hs+9−9
@@ -427,20 +427,20 @@ checkTakeDropTime (mt0, mt1) = do
427427 return r
428428
429429#ifdef DEVBUILD
430−testTakeByTime :: IO Bool
431−testTakeByTime = do
430+testTakeInterval :: IO Bool
431+testTakeInterval = do
432432 r <-
433− S.fold ((,) <$> FL.head <*> FL.last)
434− $ IS.takeByTime takeDropTime
433+ S.fold (FL.tee FL.head FL.last)
434+ $ IS.takeInterval takeDropTime
435435 $ S.repeatM (threadDelay 1000 >> getTime Monotonic)
436436 checkTakeDropTime r
437437
438−testDropByTime :: IO Bool
439−testDropByTime = do
438+testDropInterval :: IO Bool
439+testDropInterval = do
440440 t0 <- getTime Monotonic
441441 mt1 <-
442442 S.head
443− $ IS.dropByTime takeDropTime
443+ $ IS.dropInterval takeDropTime
444444 $ S.repeatM (threadDelay 1000 >> getTime Monotonic)
445445 checkTakeDropTime (Just t0, mt1)
446446#endif
@@ -633,8 +633,8 @@ main = hspec
633633
634634#ifdef DEVBUILD
635635 describe "Filtering" $ do
636− it "takeByTime" (testTakeByTime `shouldReturn` True)
637− it "dropByTime" (testDropByTime `shouldReturn` True)
636+ it "takeInterval" (testTakeInterval `shouldReturn` True)
637+ it "dropInterval" (testDropInterval `shouldReturn` True)
638638#endif
639639
640640 describe "Stream group and split operations" $ do
test/lib/Streamly/Test/Prelude/Common.hs+2−2
@@ -1456,7 +1456,7 @@ bracketPartialStreamProp t vec =
14561456 (S.fromList vec))
14571457 run $ do
14581458 performMajorGC
1459− threadDelay 10000
1459+ threadDelay 1000000
14601460 refValue <- run $ readIORef ioRef
14611461 when (refValue /= 0 && refValue /= 3) $
14621462 error $ "refValue == " ++ show refValue
@@ -1516,7 +1516,7 @@ finallyPartialStreamProp t vec =
15161516 (S.fromList vec))
15171517 run $ do
15181518 performMajorGC
1519− threadDelay 10000
1519+ threadDelay 100000
15201520 refValue <- run $ readIORef ioRef
15211521 when (refValue /= 0 && refValue /= 2) $
15221522 error $ "refValue == " ++ show refValue
test/streamly-tests.cabal+1
@@ -179,6 +179,7 @@ common always-optimized
179179 -fdicts-strict
180180 -fmax-worker-args=16
181181 -fspec-constr-recursive=16
182+ -rtsopts
182183 if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
183184 ghc-options: -fplugin Fusion.Plugin
184185