1- {-# LANGUAGE CPP #-}
21{-# OPTIONS_GHC -fno-warn-deprecations #-}
32module UnitTests.Distribution.SPDX (spdxTests ) where
43
@@ -12,14 +11,6 @@ import Distribution.Pretty (prettyShow)
1211import Test.Tasty
1312import Test.Tasty.QuickCheck
1413
15- #if MIN_VERSION_binary(0,7,0)
16- import qualified Data.Binary as Binary
17- import qualified Data.Binary.Get as Binary
18- import qualified Data.Binary.Put as Binary
19- import qualified Data.ByteString.Lazy as LBS
20- import GHC.Generics (to , from )
21- #endif
22-
2314import Test.QuickCheck.Instances.Cabal ()
2415
2516spdxTests :: [TestTree ]
@@ -43,29 +34,6 @@ licenseExceptionIdRoundtrip x =
4334 counterexample (prettyShow x) $
4435 Right x === eitherParsec (prettyShow x)
4536
46- #if MIN_VERSION_binary(0,7,0)
47- licenseExceptionIdBinaryPut :: LicenseExceptionId -> Property
48- licenseExceptionIdBinaryPut x =
49- Binary. runPut (Binary. put x)
50- ===
51- Binary. runPut (Binary. gput (from x))
52-
53- licenseExceptionIdBinaryGet :: Word8 -> Property
54- licenseExceptionIdBinaryGet w0 =
55- stripMsg id (Binary. runGetOrFail Binary. get bs)
56- ===
57- stripMsg to (Binary. runGetOrFail Binary. gget bs)
58- where
59- bs = LBS. pack [w0]
60-
61- stripMsg
62- :: (a -> LicenseExceptionId )
63- -> Either (x , y , String ) (x , y , a )
64- -> Either (x , y ) (x , y , LicenseExceptionId )
65- stripMsg _ (Left (x,y,_)) = Left (x,y)
66- stripMsg f (Right (x,y,t)) = Right (x,y,f t)
67- #endif
68-
6937licenseRefRoundtrip :: LicenseRef -> Property
7038licenseRefRoundtrip x =
7139 counterexample (prettyShow x) $
0 commit comments