@@ -1,10 +1,10 @@
1−{-# LANGUAGE StandaloneDeriving, DeriveAnyClass #-}
2−{-# LANGUAGE DataKinds #-}
3−{-# LANGUAGE TypeApplications #-}
4−{-# HLINT ignore "Use newtype instead of data" #-}
5−{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
1+{-# LANGUAGE StandaloneDeriving #-}
2+{-# LANGUAGE DeriveAnyClass #-}
3+{-# LANGUAGE TemplateHaskell #-}
4+
5+-- This module has a lot of orphan instances as we are deriving it here. We can
6+-- ignore this warning.
67{-# OPTIONS_GHC -Wno-orphans #-}
7−{-# OPTIONS_GHC -Wno-simplifiable-class-constraints #-}
88
99-- |
1010-- Module : Streamly.Test.Data.Unbox
@@ -40,8 +40,6 @@ import Streamly.Internal.Data.Unbox
4040
4141import Test.Hspec as H
4242
43−import qualified Streamly.Internal.Data.Serialize as Serialize
44−
4543--------------------------------------------------------------------------------
4644-- Types
4745--------------------------------------------------------------------------------
@@ -148,27 +146,6 @@ testGenericConsistency val = do
148146checkSizeOf :: forall a. Unbox a => Proxy a -> Int -> IO ()
149147checkSizeOf _ size = sizeOf (Proxy :: Proxy a) `shouldBe` size
150148
151−testSerializeList
152− :: forall a. (Eq a, Show a, Serialize.Serialize a)
153− => Int
154− -> a
155− -> IO ()
156−testSerializeList sizeOfA val = do
157−
158− let sz =
159− case Serialize.size :: Serialize.Size a of
160− Serialize.VarSize f -> f val
161− Serialize.ConstSize csz -> csz
162−
163− sz `shouldBe` sizeOfA
164−
165− arr <- newBytes sz
166−
167− off1 <- Serialize.serialize 0 arr val
168− (off2, val2) <- Serialize.deserialize 0 arr
169− val2 `shouldBe` val
170− off2 `shouldBe` off1
171−
172149--------------------------------------------------------------------------------
173150-- CPP helpers
174151--------------------------------------------------------------------------------
@@ -226,13 +203,6 @@ testCases = do
226203 it "GenericConsistency (Identity Int)"
227204 $ testGenericConsistency (Identity 56760 :: Identity Int)
228205
229− it "Serialize [Int]"
230− $ testSerializeList (8 + 4 * 8) ([1, 2, 3, 4] :: [Int])
231− it "Serialize [[Int]]"
232− $ testSerializeList
233− (8 + 3 * 8 + 6 * 8)
234− ([[1], [1, 2], [1, 2, 3]] :: [[Int]])
235−
236206 -- Fingerprint does not work for GHC 8.6.5
237207 -- it "Fingerprint" $ testSerialization (Fingerprint 123456 876588)
238208 -- it "GenericConsistency Fingerprint"