@@ -1,10 +1,10 @@
1−{-# LANGUAGE StandaloneDeriving, DeriveAnyClass #-}
1+{-# LANGUAGE StandaloneDeriving #-}
2+{-# LANGUAGE DeriveAnyClass #-}
2−{-# LANGUAGE DataKinds #-}
3+{-# LANGUAGE TemplateHaskell #-}
3−{-# LANGUAGE TypeApplications #-}
4+
4−{-# HLINT ignore "Use newtype instead of data" #-}
5+-- This module has a lot of orphan instances as we are deriving it here. We can
5−{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
6+-- ignore this warning.
6{-# OPTIONS_GHC -Wno-orphans #-}
7{-# OPTIONS_GHC -Wno-orphans #-}
7−{-# OPTIONS_GHC -Wno-simplifiable-class-constraints #-}
10-- Module : Streamly.Test.Data.Unbox
10-- Module : Streamly.Test.Data.Unbox
@@ -40,8 +40,6 @@ import Streamly.Internal.Data.Unbox
41import Test.Hspec as H
41import Test.Hspec as H
43−import qualified Streamly.Internal.Data.Serialize as Serialize
45--------------------------------------------------------------------------------
43--------------------------------------------------------------------------------
47--------------------------------------------------------------------------------
45--------------------------------------------------------------------------------
@@ -148,27 +146,6 @@ testGenericConsistency val = do
148checkSizeOf :: forall a. Unbox a => Proxy a -> Int -> IO ()
146checkSizeOf :: forall a. Unbox a => Proxy a -> Int -> IO ()
149checkSizeOf _ size = sizeOf (Proxy :: Proxy a) `shouldBe` size
147checkSizeOf _ size = sizeOf (Proxy :: Proxy a) `shouldBe` size
152− :: forall a. (Eq a, Show a, Serialize.Serialize a)
156−testSerializeList sizeOfA val = do
159− case Serialize.size :: Serialize.Size a of
160− Serialize.VarSize f -> f val
161− Serialize.ConstSize csz -> csz
163− sz `shouldBe` sizeOfA
167− off1 <- Serialize.serialize 0 arr val
168− (off2, val2) <- Serialize.deserialize 0 arr
170− off2 `shouldBe` off1
172--------------------------------------------------------------------------------
149--------------------------------------------------------------------------------
173-- CPP helpers
150-- CPP helpers
174--------------------------------------------------------------------------------
151--------------------------------------------------------------------------------
@@ -226,13 +203,6 @@ testCases = do
226 it "GenericConsistency (Identity Int)"
203 it "GenericConsistency (Identity Int)"
227 $ testGenericConsistency (Identity 56760 :: Identity Int)
204 $ testGenericConsistency (Identity 56760 :: Identity Int)
229− it "Serialize [Int]"
230− $ testSerializeList (8 + 4 * 8) ([1, 2, 3, 4] :: [Int])
231− it "Serialize [[Int]]"
234− ([[1], [1, 2], [1, 2, 3]] :: [[Int]])
236 -- Fingerprint does not work for GHC 8.6.5
206 -- Fingerprint does not work for GHC 8.6.5
237 -- it "Fingerprint" $ testSerialization (Fingerprint 123456 876588)
207 -- it "Fingerprint" $ testSerialization (Fingerprint 123456 876588)
238 -- it "GenericConsistency Fingerprint"
208 -- it "GenericConsistency Fingerprint"