mirror of
https://github.com/composewell/streamly.git
synced 2024-08-16 23:10:36 +03:00
Fix hlint issues in tests
This commit is contained in:
parent
86ad39afeb
commit
ce86302f08
@ -13,6 +13,7 @@ test/Streamly/Test/Data/Unfold.hs
|
||||
test/Streamly/Test/FileSystem/Event.hs
|
||||
test/Streamly/Test/Prelude/Concurrent.hs
|
||||
test/Streamly/Test/Data/Stream/Concurrent.hs
|
||||
test/lib/Streamly/Test/Prelude/Common.hs
|
||||
test/Streamly/Test/Prelude/Fold.hs
|
||||
test/Streamly/Test/Prelude/Rate.hs
|
||||
test/Streamly/Test/Prelude/Serial.hs
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
module Main (main) where
|
||||
|
||||
import Data.List (sort)
|
||||
import Data.List (sort, sortBy)
|
||||
import Data.Ord (comparing, Down(..))
|
||||
import Data.Semigroup (Sum(..), getSum)
|
||||
import Streamly.Test.Common (checkListEqual, listEquals)
|
||||
import Test.QuickCheck
|
||||
@ -412,7 +413,7 @@ partitionByM =
|
||||
where
|
||||
|
||||
action ls = do
|
||||
let f = \x -> if odd x then return (Left x) else return (Right x)
|
||||
let f x = if odd x then return (Left x) else return (Right x)
|
||||
v1 <-
|
||||
run
|
||||
$ Stream.fold (Fold.partitionByM f Fold.length Fold.length)
|
||||
@ -429,7 +430,7 @@ partitionByFstM =
|
||||
where
|
||||
|
||||
action _ = do
|
||||
let f = \x -> if odd x then return (Left x) else return (Right x)
|
||||
let f x = if odd x then return (Left x) else return (Right x)
|
||||
v1 <-
|
||||
run
|
||||
$ Stream.fold
|
||||
@ -447,7 +448,7 @@ partitionByMinM1 =
|
||||
where
|
||||
|
||||
action _ = do
|
||||
let f = \x -> if odd x then return (Left x) else return (Right x)
|
||||
let f x = if odd x then return (Left x) else return (Right x)
|
||||
v1 <-
|
||||
run
|
||||
$ Stream.fold
|
||||
@ -465,7 +466,7 @@ partitionByMinM2 =
|
||||
where
|
||||
|
||||
action _ = do
|
||||
let f = \x -> if odd x then return (Left x) else return (Right x)
|
||||
let f x = if odd x then return (Left x) else return (Right x)
|
||||
v1 <-
|
||||
run
|
||||
$ Stream.fold
|
||||
@ -690,7 +691,7 @@ topBy isTop = forAll (listOf (chooseInt (-50, 100))) $ \ls0 ->
|
||||
if isTop
|
||||
then do
|
||||
lst <- Stream.fold (Fold.top n) (Stream.fromList ls) >>= MArray.toList
|
||||
assert ((Prelude.take n . Prelude.reverse . sort) ls == lst)
|
||||
assert ((Prelude.take n . sortBy (comparing Down)) ls == lst)
|
||||
else do
|
||||
lst <- Stream.fold (Fold.bottom n) (Stream.fromList ls) >>= MArray.toList
|
||||
assert ((Prelude.take n . sort) ls == lst)
|
||||
|
@ -26,7 +26,7 @@ import Test.QuickCheck.Gen (oneof)
|
||||
genDatatype :: String -> Int -> Q [Dec]
|
||||
genDatatype tyName numCons =
|
||||
sequence
|
||||
([ dataD
|
||||
[ dataD
|
||||
(pure [])
|
||||
(mkName tyName)
|
||||
[]
|
||||
@ -49,7 +49,7 @@ genDatatype tyName numCons =
|
||||
[]
|
||||
]
|
||||
]
|
||||
])
|
||||
]
|
||||
|
||||
where
|
||||
|
||||
|
@ -75,7 +75,7 @@ readFromHandle =
|
||||
|
||||
readWithBufferFromHandle :: IO (Stream IO Char)
|
||||
readWithBufferFromHandle =
|
||||
let f1 = (\h -> (1024, h))
|
||||
let f1 h = (1024, h)
|
||||
f2 = Unicode.decodeUtf8 . Stream.unfold Handle.readerWith . f1
|
||||
in executor f2
|
||||
|
||||
@ -88,7 +88,7 @@ readChunksFromHandle =
|
||||
|
||||
readChunksWithBuffer :: IO (Stream IO Char)
|
||||
readChunksWithBuffer =
|
||||
let f1 = (\h -> (1024, h))
|
||||
let f1 h = (1024, h)
|
||||
f2 =
|
||||
Unicode.decodeUtf8
|
||||
. Stream.concatMap Array.read
|
||||
|
@ -54,7 +54,7 @@ checkEqual opName op (mc1, mc2) = do
|
||||
checkOp :: String -> NormalizationMode -> [(Text, Text)] -> IO Bool
|
||||
checkOp name op pairs = do
|
||||
res <- mapM (checkEqual name (normalize op)) pairs
|
||||
return $ all (== True) res
|
||||
return $ and res
|
||||
|
||||
checkNFC :: (Text, Text, Text, Text, Text) -> IO Bool
|
||||
checkNFC (c1, c2, c3, c4, c5) =
|
||||
|
Loading…
Reference in New Issue
Block a user