on master help sign in
Apply hlint suggesstions on common array test file
5998dd8adithyaov
test/Streamly/Test/Data/Array/Common.hs+5−5
@@ -32,7 +32,7 @@ genericTestFrom arrFold =
32 assert (A.length arr == len)
32 assert (A.length arr == len)
33
33
34testLength :: Property
34testLength :: Property
35−testLength = genericTestFrom (\n -> S.fold (A.writeN n))
35+testLength = genericTestFrom (S.fold . A.writeN)
36
36
37testLengthFromStreamN :: Property
37testLengthFromStreamN :: Property
38testLengthFromStreamN = genericTestFrom A.fromStreamN
38testLengthFromStreamN = genericTestFrom A.fromStreamN
@@ -53,16 +53,16 @@ genericTestFromTo arrFold arrUnfold listEq =
53
53
54testFoldNUnfold :: Property
54testFoldNUnfold :: Property
55testFoldNUnfold =
55testFoldNUnfold =
56− genericTestFromTo (\n -> S.fold (A.writeN n)) (S.unfold A.read) (==)
56+ genericTestFromTo (S.fold . A.writeN) (S.unfold A.read) (==)
57
57
58testFoldNToStream :: Property
58testFoldNToStream :: Property
59testFoldNToStream =
59testFoldNToStream =
60− genericTestFromTo (\n -> S.fold (A.writeN n)) A.toStream (==)
60+ genericTestFromTo (S.fold . A.writeN) A.toStream (==)
61
61
62testFoldNToStreamRev :: Property
62testFoldNToStreamRev :: Property
63testFoldNToStreamRev =
63testFoldNToStreamRev =
64 genericTestFromTo
64 genericTestFromTo
65− (\n -> S.fold (A.writeN n))
65+ (S.fold . A.writeN)
66 A.toStreamRev
66 A.toStreamRev
67 (\xs list -> xs == reverse list)
67 (\xs list -> xs == reverse list)
68
68
@@ -79,7 +79,7 @@ testFromListN =
79 forAll (vectorOf len (arbitrary :: Gen Int)) $ \list ->
79 forAll (vectorOf len (arbitrary :: Gen Int)) $ \list ->
80 monadicIO $ do
80 monadicIO $ do
81 let arr = A.fromListN n list
81 let arr = A.fromListN n list
82− xs <- run $ S.toList $ (S.unfold A.read) arr
82+ xs <- run $ S.toList $ S.unfold A.read arr
83 listEquals (==) xs (take n list)
83 listEquals (==) xs (take n list)
84
84
85foldManyWith :: (Int -> Fold IO Int (Array Int)) -> Property
85foldManyWith :: (Int -> Fold IO Int (Array Int)) -> Property