Skip to content

Commit

Permalink
Satisfy -Werror=unused-top-binds
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Dec 19, 2023
1 parent feaa338 commit e693aaa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 64 deletions.
32 changes: 0 additions & 32 deletions Cabal-tests/tests/UnitTests/Distribution/SPDX.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-deprecations #-}
module UnitTests.Distribution.SPDX (spdxTests) where

Expand All @@ -12,14 +11,6 @@ import Distribution.Pretty (prettyShow)
import Test.Tasty
import Test.Tasty.QuickCheck

#if MIN_VERSION_binary(0,7,0)
import qualified Data.Binary as Binary
import qualified Data.Binary.Get as Binary
import qualified Data.Binary.Put as Binary
import qualified Data.ByteString.Lazy as LBS
import GHC.Generics (to, from)
#endif

import Test.QuickCheck.Instances.Cabal ()

spdxTests :: [TestTree]
Expand All @@ -43,29 +34,6 @@ licenseExceptionIdRoundtrip x =
counterexample (prettyShow x) $
Right x === eitherParsec (prettyShow x)

#if MIN_VERSION_binary(0,7,0)
licenseExceptionIdBinaryPut :: LicenseExceptionId -> Property
licenseExceptionIdBinaryPut x =
Binary.runPut (Binary.put x)
===
Binary.runPut (Binary.gput (from x))

licenseExceptionIdBinaryGet :: Word8 -> Property
licenseExceptionIdBinaryGet w0 =
stripMsg id (Binary.runGetOrFail Binary.get bs)
===
stripMsg to (Binary.runGetOrFail Binary.gget bs)
where
bs = LBS.pack [w0]

stripMsg
:: (a -> LicenseExceptionId)
-> Either (x, y, String) (x, y, a)
-> Either (x, y) (x, y, LicenseExceptionId)
stripMsg _ (Left (x,y,_)) = Left (x,y)
stripMsg f (Right (x,y,t)) = Right (x,y,f t)
#endif

licenseRefRoundtrip :: LicenseRef -> Property
licenseRefRoundtrip x =
counterexample (prettyShow x) $
Expand Down
33 changes: 1 addition & 32 deletions Cabal-tests/tests/UnitTests/Distribution/Simple/Program/GHC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -190,35 +190,4 @@ options_9_0_all =
options_9_0_affects :: [String]
options_9_0_affects =
[ "-fcmm-static-pred"
]

-------------------------------------------------------------------------------
-- GHC-9.2
-------------------------------------------------------------------------------

options_9_2_all :: [String]
options_9_2_all =
[ "-dynohi"
, "-ddump-c-backend"
, "-ddump-stg-from-core"
, "-ddump-stg"
, "-ddump-faststrings"
, "--run"
, "-ffamily-application-cache"
, "-fno-family-application-cache"
] ++ options_9_2_affects

options_9_2_affects :: [String]
options_9_2_affects =
[ "-fprof-callers"
, "-funfolding-case-threshold"
, "-funfolding-case-scaling"
, "-fdistinct-constructor-tables"
, "-finfo-table-map"
, "-fexpose-internal-symbols"
, "-finline-generics"
, "-finline-generics-aggressively"
, "-fno-expose-internal-symbols"
, "-fno-inline-generics"
, "-fno-inline-generics-aggressively"
]
]

0 comments on commit e693aaa

Please sign in to comment.