on master help sign in
Fix test cases for StreamD/StreamK split up
commit8629a0e806f5eea87d23650c540aa04176f25c43 authorRanjeet Kumar Ranjan <ranjeetr@composewell.com> dateFri 3 Feb 2023, 12:26 (4 years ago) parente249c4d
12 files changed+92−78
.hlint.ignore+1 targets/Targets.hs+1−1 test/Streamly/Test/Data/Array/Stream.hs+3−2 test/Streamly/Test/Data/Parser/Chunked.hs+1−1 test/Streamly/Test/Data/Parser/ParserD.hs+1 test/Streamly/Test/Data/Stream/Concurrent.hs+4−4 test/Streamly/Test/FileSystem/Event/Common.hs+5−3 test/Streamly/Test/Network/Inet/TCP.hs+5−4 test/Streamly/Test/Network/Socket.hs+5−4 test/Streamly/Test/Prelude/Serial.hs+35−32 test/Streamly/Test/Unicode/Stream.hs+29−27 test/streamly-tests.cabal+2
.hlint.ignore+1
@@ -9,6 +9,7 @@ test/Streamly/Test/Data/SmallArray.hs
99test/Streamly/Test/Data/Unfold.hs
1010test/Streamly/Test/FileSystem/Event.hs
1111test/Streamly/Test/Prelude/Concurrent.hs
12+test/Streamly/Test/Data/Stream/Concurrent.hs
1213test/Streamly/Test/Prelude/Fold.hs
1314test/Streamly/Test/Prelude/Rate.hs
1415test/Streamly/Test/Prelude/Serial.hs
targets/Targets.hs+1−1
@@ -207,6 +207,6 @@ targets =
207207 , ("Network.Inet.TCP", ["noBench"])
208208 , ("version-bounds", ["noBench"])
209209
210− , ("Data.List", ["list_grp", "noBench"])
210+ , ("Data.List", ["list_grp", "noBench", "testDevOnly"])
211211 , ("Data.List.Base", ["list_grp", "noBench"])
212212 ]
test/Streamly/Test/Data/Array/Stream.hs+3−2
@@ -55,11 +55,12 @@ parseBreak = do
5555 monadicIO $ do
5656 (ls1, str) <-
5757 let input =
58− chunksOf
58+ Stream.toStreamK
59+ $ chunksOf
5960 clen (Array.writeN clen) (Stream.fromList ls)
6061 parser = Parser.fromFold (Fold.take tlen Fold.toList)
6162 in run $ ArrayStream.parseBreak parser input
62− ls2 <- run $ Stream.fold Fold.toList (ArrayStream.concat str)
63+ ls2 <- run $ Stream.fold Fold.toList (ArrayStream.concat $ Stream.fromStreamK str)
6364 case ls1 of
6465 Right x -> listEquals (==) (x ++ ls2) ls
6566 Left _ -> assert False
test/Streamly/Test/Data/Parser/Chunked.hs+1−1
@@ -686,7 +686,7 @@ some =
686686
687687parse :: (Monad f, Unbox a) =>
688688 P.ChunkParser a f b -> S.Stream f (A.Array a) -> f (Either ParseError b)
689−parse parser stream = fmap fst (P.parseBreak parser stream)
689+parse parser stream = fmap fst (P.parseBreak parser $ S.toStreamK stream)
690690
691691applicative :: Property
692692applicative =
test/Streamly/Test/Data/Parser/ParserD.hs+1
@@ -13,6 +13,7 @@ import Test.QuickCheck.Monadic (monadicIO, assert, run)
1313
1414import qualified Data.List as List
1515import qualified Prelude
16+import qualified Streamly.Data.Stream as S
1617import qualified Streamly.Internal.Data.Array as A
1718import qualified Streamly.Internal.Data.Fold as FL
1819import qualified Streamly.Internal.Data.Parser.ParserD as P
test/Streamly/Test/Data/Stream/Concurrent.hs+4−4
@@ -131,10 +131,10 @@ exceptionPropagation f = do
131131 (Left (ExampleException "E") :: Either ExampleException [Int])
132132 it "append nested throwM" $ do
133133 let nested =
134− Stream.fromFoldable [1..10]
134+ (Stream.fromList [1..10])
135135 `f` Stream.fromEffect (throwM (ExampleException "E"))
136− `f` Stream.fromFoldable [1..10]
137− try (tl (Stream.nil `f` nested `f` Stream.fromFoldable [1..10]))
136+ `f` (Stream.fromList [1..10])
137+ try (tl (Stream.nil `f` nested `f` (Stream.fromList [1..10])))
138138 `shouldReturn`
139139 (Left (ExampleException "E")
140140 :: Either ExampleException [Int])
@@ -182,7 +182,7 @@ timeOrdering f = do
182182
183183takeCombined :: Int -> IO ()
184184takeCombined n = do
185− let constr = Stream.fromFoldable
185+ let constr = Stream.fromList
186186 let s = Async.parList id [constr ([] :: [Int]), constr ([] :: [Int])]
187187 r <- Stream.fold Fold.toList $ Stream.take n s
188188 r `shouldBe` []
test/Streamly/Test/FileSystem/Event/Common.hs+5−3
@@ -66,7 +66,8 @@ import System.IO.Temp (withSystemTempDirectory)
6666
6767import qualified Data.List.NonEmpty as NonEmpty
6868import qualified Streamly.Internal.Data.Array as Array
69−import qualified Streamly.Internal.Data.Stream.IsStream as Stream
69+import qualified Streamly.Internal.Data.Stream as Stream
70+import qualified Streamly.Internal.Data.Stream.Concurrent as Stream
7071import qualified Streamly.Unicode.Stream as Unicode
7172
7273#if defined(FILESYSTEM_EVENT_LINUX)
@@ -95,7 +96,7 @@ type EventChecker =
9596 -> MVar () -- mvar to sync file system ops and the watch
9697 -> [(String, Event -> Bool)] -- expected events
9798 -> IO ()
98−type EventWatcher = NonEmpty (Array Word8) -> Stream.SerialT IO Event.Event
99+type EventWatcher = NonEmpty (Array Word8) -> Stream.Stream IO Event.Event
99100
100101eventMatches :: Event -> (String, Event -> Bool) -> Bool
101102eventMatches ev (expectedPath, f) =
@@ -193,7 +194,8 @@ driver checker symlinkStyle (desc, pre, ops, expected) =
193194 -- with the events occurred after the watch is started.
194195 let check = checker root target sync expected
195196 fsOps = Stream.fromEffect $ runFSOps root sync
196− Stream.drain $ Stream.fromEffect check `Stream.parallelFst` fsOps
197+ Stream.drain
198+ $ Stream.parListEagerFst [Stream.fromEffect check, fsOps]
197199
198200 runFSOps fp sync = do
199201 -- We put the MVar before the event watcher starts to run but that does
test/Streamly/Test/Network/Inet/TCP.hs+5−4
@@ -22,11 +22,12 @@ import Streamly.Internal.Data.Stream (Stream)
2222import Test.QuickCheck (Property)
2323import Test.QuickCheck.Monadic (monadicIO, assert, run)
2424
25+import qualified Streamly.Data.Fold as Fold
26+import qualified Streamly.Data.Stream.Prelude as Stream
2527import qualified Streamly.Internal.Data.Unfold as Unfold
2628import qualified Streamly.Internal.Network.Inet.TCP as TCP
2729import qualified Streamly.Internal.Network.Socket as Socket
2830import qualified Streamly.Internal.Unicode.Stream as Unicode
29−import qualified Streamly.Prelude as Stream
3031
3132import Test.Hspec
3233import Test.Hspec.QuickCheck
@@ -73,9 +74,9 @@ server
7374 -> IO ()
7475server listener port sem handler = do
7576 putMVar sem ()
76− Stream.fromSerial (Stream.unfold listener port)
77− & (Stream.fromAsync . Stream.mapM (Socket.forSocketM handler))
78− & Stream.drain
77+ Stream.unfold listener port
78+ & Stream.mapM (Socket.forSocketM handler)
79+ & Stream.fold Fold.drain
7980
8081remoteAddr :: (Word8,Word8,Word8,Word8)
8182remoteAddr = (127, 0, 0, 1)
test/Streamly/Test/Network/Socket.hs+5−4
@@ -22,10 +22,11 @@ import Streamly.Internal.Data.Stream (Stream)
2222import Test.QuickCheck (Property)
2323import Test.QuickCheck.Monadic (monadicIO, assert, run)
2424
25+import qualified Streamly.Data.Fold as Fold
26+import qualified Streamly.Data.Stream.Prelude as Stream
2527import qualified Streamly.Internal.Network.Inet.TCP as TCP
2628import qualified Streamly.Internal.Network.Socket as Socket
2729import qualified Streamly.Internal.Unicode.Stream as Unicode
28−import qualified Streamly.Prelude as Stream
2930
3031import Test.Hspec
3132import Test.Hspec.QuickCheck
@@ -86,9 +87,9 @@ basePort = 64000
8687server :: PortNumber -> MVar () -> (Socket -> IO ()) -> IO ()
8788server port sem handler = do
8889 putMVar sem ()
89− Stream.fromSerial (Stream.unfold TCP.acceptorOnPort port)
90− & Stream.fromAsync . Stream.mapM (Socket.forSocketM handler)
91− & Stream.drain
90+ Stream.unfold TCP.acceptorOnPort port
91+ & Stream.mapM (Socket.forSocketM handler)
92+ & Stream.fold Fold.drain
9293
9394remoteAddr :: (Word8,Word8,Word8,Word8)
9495remoteAddr = (127, 0, 0, 1)
test/Streamly/Test/Prelude/Serial.hs+35−32
@@ -1,4 +1,5 @@
11{-# OPTIONS_GHC -Wno-deprecations #-}
2+{-# Language TypeApplications #-}
23
34-- |
45-- Module : Streamly.Test.Prelude.Serial
@@ -48,8 +49,10 @@ import qualified Streamly.Data.Stream.Prelude as S
4849import qualified Streamly.Internal.Data.Fold as FL
4950import qualified Streamly.Internal.Data.Unfold as UF
5051import qualified Streamly.Internal.Data.Stream as IS
52+import qualified Streamly.Internal.Data.Stream.StreamK as K
5153import qualified Streamly.Data.Array as A
5254import qualified Streamly.Internal.Data.Parser as Parser
55+import qualified Streamly.Prelude as SP
5356
5457import Streamly.Internal.Data.Time.Units
5558 (AbsTime, NanoSecond64(..), toRelTime64, diffAbsTime64)
@@ -90,8 +93,8 @@ groupsByRolling :: Monad m =>
9093groupsByRolling cmp f m =
9194 S.catRights $ S.parseMany (Parser.groupByRolling cmp f) m
9295
93−drainWhile :: Monad m => (a -> Bool) -> S.Stream m a -> m ()
94−drainWhile p = S.fold FL.drain . S.takeWhile p
96+drainWhile :: Monad m => (a -> Bool) -> SerialT m a -> m ()
97+drainWhile p m = SP.fold FL.drain $ SP.takeWhile p m
9598
9699drainMapM :: Monad m => (a -> m b) -> S.Stream m a -> m ()
97100drainMapM f = S.fold (FL.drainMapM f)
@@ -427,12 +430,12 @@ associativityCheck desc t = prop desc assocCheckProp
427430 assocCheckProp :: [Int] -> [Int] -> [Int] -> Property
428431 assocCheckProp xs ys zs =
429432 monadicIO $ do
430− let xStream = S.fromList xs
431− yStream = S.fromList ys
432− zStream = S.fromList zs
433+ let xStream = SP.fromList xs
434+ yStream = SP.fromList ys
435+ zStream = SP.fromList zs
433436 infixAssocstream <-
434− run $ toList $ t $ xStream `serial` yStream `serial` zStream
435− assocStream <- run $ toList $ t $ xStream <> yStream <> zStream
437+ run $ SP.toList $ t $ xStream `serial` yStream `serial` zStream
438+ assocStream <- run $ SP.toList $ t $ xStream <> yStream <> zStream
436439 listEquals (==) infixAssocstream assocStream
437440
438441max_length :: Int
@@ -540,7 +543,7 @@ foldIterateM =
540543sortBy :: Property
541544sortBy = forAll (listOf (chooseInt (0, max_length))) $ \lst -> monadicIO $ do
542545 let s1 = sort lst
543− s2 <- toList $ IS.sortBy compare $ S.fromList lst
546+ s2 <- toList $ K.toStream (K.sortBy compare $ K.fromStream $ S.fromList lst)
544547 assert $ s1 == s2
545548
546549moduleName :: String
@@ -560,15 +563,15 @@ main = hspec
560563 <> [("maxBuffer -1", fromSerial . maxBuffer (-1))]
561564#endif
562565 let toListSerial :: SerialT IO a -> IO [a]
563− toListSerial = toList . fromSerial
566+ toListSerial = SP.toList
564567
565568 describe "Runners" $ do
566569 -- XXX use an IORef to store and check the side effects
567570 it "simple serially" $
568− (S.fold FL.drain . fromSerial)
571+ (SP.fold FL.drain . fromSerial)
569572 (return (0 :: Int)) `shouldReturn` ()
570573 it "simple serially with IO" $
571− (S.fold FL.drain . fromSerial)
574+ (S.fold FL.drain)
572575 (S.fromEffect $ putStrLn "hello") `shouldReturn` ()
573576
574577 describe "Empty" $
@@ -601,8 +604,8 @@ main = hspec
601604 serialOps $ prop "serially unfoldr" . constructWithUnfoldr id
602605 serialOps $ prop "serially fromPure" . constructWithFromPure id
603606 serialOps $ prop "serially fromEffect" . constructWithFromEffect id
604− serialOps $ prop "serially cons" . constructWithCons S.cons
605− serialOps $ prop "serially consM" . constructWithConsM S.consM id
607+ serialOps $ prop "serially cons" . constructWithCons SP.cons
608+ serialOps $ prop "serially consM" . constructWithConsM SP.consM id
606609
607610 describe "From Generators" $ do
608611 prop "unfold" unfold
@@ -610,7 +613,7 @@ main = hspec
610613 describe "Simple Operations" $ serialOps simpleOps
611614
612615 describe "Functor operations" $ do
613− serialOps $ functorOps S.fromFoldable "serially" (==)
616+ serialOps $ functorOps (SP.fromFoldable) "serially" (==)
614617 serialOps $ functorOps folded "serially folded" (==)
615618
616619 describe "Monoid operations" $ do
@@ -639,17 +642,17 @@ main = hspec
639642 -- The tests using sorted equality are weaker tests
640643 -- We need to have stronger unit tests for all those
641644 -- XXX applicative with three arguments
642− serialOps $ applicativeOps S.fromFoldable "serially" (==)
645+ serialOps $ applicativeOps (SP.fromFoldable) "serially" (==)
643646 serialOps $ applicativeOps folded "serially folded" (==)
644− serialOps $ applicativeOps1 S.fromFoldable "serially" (==)
645− serialOps $ applicativeOps1 S.fromFoldable "serially folded" (==)
647+ serialOps $ applicativeOps1 (SP.fromFoldable) "serially" (==)
648+ serialOps $ applicativeOps1 (SP.fromFoldable) "serially folded" (==)
646649
647650 -- XXX add tests for indexed/indexedR
648651 describe "Zip operations" $ do
649652 -- We test only the serial zip with serial streams and the parallel
650653 -- stream, because the rate setting in these streams can slow down
651654 -- zipAsync.
652− serialOps $ prop "zip monadic serially" . zipMonadic S.fromFoldable (==)
655+ serialOps $ prop "zip monadic serially" . zipMonadic (SP.fromFoldable) (==)
653656 serialOps $ prop "zip monadic serially folded" . zipMonadic folded (==)
654657
655658 -- XXX add merge tests like zip tests
@@ -658,15 +661,15 @@ main = hspec
658661 -- describe "Merge operations" $ do
659662
660663 describe "Monad operations" $ do
661− serialOps $ prop "serially monad then" . monadThen S.fromFoldable (==)
664+ serialOps $ prop "serially monad then" . monadThen (SP.fromFoldable) (==)
662665 serialOps $ prop "serially monad then folded" . monadThen folded (==)
663− serialOps $ prop "serially monad bind" . monadBind S.fromFoldable (==)
666+ serialOps $ prop "serially monad bind" . monadBind (SP.fromFoldable) (==)
664667 serialOps $ prop "serially monad bind folded" . monadBind folded (==)
665668
666669 describe "Stream transform and combine operations" $ do
667− serialOps $ transformCombineOpsCommon S.fromFoldable "serially" (==)
670+ serialOps $ transformCombineOpsCommon (SP.fromFoldable) "serially" (==)
668671 serialOps $ transformCombineOpsCommon folded "serially" (==)
669− serialOps $ transformCombineOpsOrdered S.fromFoldable "serially" (==)
672+ serialOps $ transformCombineOpsOrdered (SP.fromFoldable) "serially" (==)
670673 serialOps $ transformCombineOpsOrdered folded "serially" (==)
671674
672675#ifdef DEVBUILD
@@ -678,19 +681,19 @@ main = hspec
678681 -- Just some basic sanity tests for now
679682 let input = [[1,1] :: [Int],[2,2],[3,3],[4,4],[5,5],[6,6],[7,7],[8,8]]
680683 mustBe g inp out =
681− toList (S.mergeMapWith g S.fromList (S.fromList inp))
684+ toList (K.toStream (K.mergeMapWith g K.fromList (K.fromList inp)))
682685 `shouldReturn` out
683686 in do
684687 it "concatPairsWith serial"
685− $ mustBe S.append input [1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8]
688+ $ mustBe K.append input [1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8]
686689 it "concatPairsWith wSerial"
687− $ mustBe S.interleave input [1,5,3,7,2,6,4,8,1,5,3,7,2,6,4,8]
690+ $ mustBe K.interleave input [1,5,3,7,2,6,4,8,1,5,3,7,2,6,4,8]
688691 it "concatPairsWith mergeBy sorted"
689692 $ mustBe
690− (S.mergeBy compare) input [1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8]
693+ (K.mergeBy compare) input [1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8]
691694 it "concatPairsWith mergeBy reversed"
692695 $ mustBe
693− (S.mergeBy compare)
696+ (K.mergeBy compare)
694697 (reverse input)
695698 [1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8]
696699 prop "sortBy" sortBy
@@ -699,9 +702,9 @@ main = hspec
699702 groupSplitOps "serially"
700703
701704 describe "Stream elimination operations" $ do
702− serialOps $ eliminationOps S.fromFoldable "serially"
705+ serialOps $ eliminationOps (SP.fromFoldable) "serially"
703706 serialOps $ eliminationOps folded "serially folded"
704− serialOps $ eliminationOpsWord8 S.fromFoldable "serially"
707+ serialOps $ eliminationOpsWord8 (SP.fromFoldable) "serially"
705708 serialOps $ eliminationOpsWord8 folded "serially folded"
706709 serialOps $ \t ->
707710 prop "drainWhile (> 0)" $ \n ->
@@ -711,15 +714,15 @@ main = hspec
711714 ioRef <- run $ newIORef ([] :: [Int])
712715 run $
713716 drainWhile (> 0) . t $
714− S.mapM (\a -> modifyIORef' ioRef (a :) >> return a) $
715− S.fromList xs
717+ SP.mapM (\a -> modifyIORef' ioRef (a :) >> return a) $
718+ SP.fromList xs
716719 strm <- run $ readIORef ioRef
717720 listEquals (==) (reverse strm) (takeWhile (> 0) xs)
718721
719722 -- XXX Add a test where we chain all transformation APIs and make sure that
720723 -- the state is being passed through all of them.
721724 describe "Stream serial elimination operations" $ do
722− serialOps $ eliminationOpsOrdered S.fromFoldable "serially"
725+ serialOps $ eliminationOpsOrdered (SP.fromFoldable) "serially"
723726 serialOps $ eliminationOpsOrdered folded "serially folded"
724727
725728 describe "Tests for S.groupsBy" groupingOps
test/Streamly/Test/Unicode/Stream.hs+29−27
@@ -19,9 +19,9 @@ import Test.QuickCheck
1919import Test.QuickCheck.Monadic (run, monadicIO, assert)
2020
2121import qualified Streamly.Data.Array as A
22+import qualified Streamly.Data.Stream as Stream
2223import qualified Streamly.Internal.Data.Stream.Chunked as AS
23−import qualified Streamly.Prelude as S
24−import qualified Streamly.Internal.Data.Stream.IsStream as S
24+import qualified Streamly.Internal.Data.Stream.StreamD as Stream
2525import qualified Streamly.Unicode.Stream as SS
2626import qualified Streamly.Internal.Unicode.Stream as IUS
2727import qualified Streamly.Internal.Unicode.Array as IUA
@@ -50,8 +50,8 @@ propDecodeEncodeId' :: Property
5050propDecodeEncodeId' =
5151 forAll genUnicode $ \list ->
5252 monadicIO $ do
53− let wrds = SS.encodeUtf8' $ S.fromList list
54− chrs <- S.toList $ SS.decodeUtf8' wrds
53+ let wrds = SS.encodeUtf8' $ Stream.fromList list
54+ chrs <- run $ Stream.toList $ SS.decodeUtf8' wrds
5555 assert (chrs == list)
5656
5757-- XXX need to use invalid characters
@@ -59,16 +59,16 @@ propDecodeEncodeId :: Property
5959propDecodeEncodeId =
6060 forAll genUnicode $ \list ->
6161 monadicIO $ do
62− let wrds = SS.encodeUtf8 $ S.fromList list
63− chrs <- S.toList $ SS.decodeUtf8 wrds
62+ let wrds = SS.encodeUtf8 $ Stream.fromList list
63+ chrs <- Stream.toList $ SS.decodeUtf8 wrds
6464 assert (chrs == list)
6565
6666propDecodeEncodeIdArrays :: Property
6767propDecodeEncodeIdArrays =
6868 forAll genUnicode $ \list ->
6969 monadicIO $ do
70− let wrds = S.arraysOf 8 $ SS.encodeUtf8' $ S.fromList list
71− chrs <- S.toList $ IUS.decodeUtf8Arrays wrds
70+ let wrds = Stream.arraysOf 8 $ SS.encodeUtf8' $ Stream.fromList list
71+ chrs <- Stream.toList $ IUS.decodeUtf8Arrays wrds
7272 assert (chrs == list)
7373
7474unicodeTestData :: [Char]
@@ -82,8 +82,10 @@ propASCIIToLatin1 =
8282 forAll (choose (1, 1000)) $ \len ->
8383 forAll (vectorOf len arbitraryASCIIChar) $ \list ->
8484 monadicIO $ do
85− let wrds = SS.decodeLatin1 $ SS.encodeLatin1 $ S.fromList list
86− lst <- run $ S.toList wrds
85+ let wrds = SS.decodeLatin1
86+ $ SS.encodeLatin1
87+ $ Stream.fromList list
88+ lst <- run $ Stream.toList wrds
8789 assert (list == lst)
8890
8991propUnicodeToLatin1 :: Property
@@ -92,8 +94,8 @@ propUnicodeToLatin1 =
9294 let wrds =
9395 SS.decodeLatin1
9496 $ SS.encodeLatin1
95− $ S.fromList unicodeTestData
96− lst <- run $ S.toList wrds
97+ $ Stream.fromList unicodeTestData
98+ lst <- run $ Stream.toList wrds
9799 assert (latin1TestData == lst)
98100
99101propUnicodeToLatin1' :: Property
@@ -102,28 +104,28 @@ propUnicodeToLatin1' =
102104 let wrds =
103105 SS.decodeLatin1
104106 $ SS.encodeLatin1'
105− $ S.fromList unicodeTestData
106− lst <- run $ S.toList wrds
107+ $ Stream.fromList unicodeTestData
108+ lst <- run $ Stream.toList wrds
107109 assert (latin1TestData == lst)
108110
109111testLines :: Property
110112testLines =
111113 forAll genUnicode $ \list ->
112114 monadicIO $ do
113− xs <- S.toList
114− $ S.map A.toList
115+ xs <- Stream.toList
116+ $ fmap A.toList
115117 $ IUA.lines
116− $ S.fromList list
118+ $ Stream.fromList list
117119 assert (xs == lines list)
118120
119121testLinesArray :: Property
120122testLinesArray =
121123 forAll genWord8 $ \list ->
122124 monadicIO $ do
123− xs <- S.toList
124− $ S.map A.toList
125+ xs <- Stream.toList
126+ $ fmap A.toList
125127 $ AS.splitOnSuffix 10
126− $ S.fromPure (A.fromList list)
128+ $ Stream.fromPure (A.fromList list)
127129 assert (xs == map (map (fromIntegral . ord))
128130 (lines (map (chr . fromIntegral) list)))
129131
@@ -131,20 +133,20 @@ testWords :: Property
131133testWords =
132134 forAll genUnicode $ \list ->
133135 monadicIO $ do
134− xs <- S.toList
135− $ S.map A.toList
136+ xs <- Stream.toList
137+ $ Stream.map A.toList
136138 $ IUA.words
137− $ S.fromList list
139+ $ Stream.fromList list
138140 assert (xs == words list)
139141
140142testUnlines :: Property
141143testUnlines =
142144 forAll genUnicode $ \list ->
143145 monadicIO $ do
144− xs <- S.toList
146+ xs <- Stream.toList
145147 $ IUA.unlines
146148 $ IUA.lines
147− $ S.fromList list
149+ $ Stream.fromList list
148150 assert (xs == unlines (lines list))
149151
150152testUnwords :: Property
@@ -152,10 +154,10 @@ testUnwords =
152154 forAll genUnicode $ \list ->
153155 monadicIO $ do
154156 xs <- run
155− $ S.toList
157+ $ Stream.toList
156158 $ IUA.unwords
157159 $ IUA.words
158− $ S.fromList list
160+ $ Stream.fromList list
159161 assert (xs == unwords (words list))
160162
161163moduleName :: String
test/streamly-tests.cabal+2
@@ -219,6 +219,8 @@ test-suite Data.List
219219 type: exitcode-stdio-1.0
220220 main-is: Streamly/Test/Data/List.hs
221221 cpp-options: -DUSE_STREAMLY_LIST
222+ if !flag(dev)
223+ buildable: False
222224
223225test-suite Data.List.Base
224226 import: test-options