diff --git a/cabal.haskell-ci b/cabal.haskell-ci index 042add7..5def30c 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -1,2 +1 @@ -tests: <9.0 installed: -directory diff --git a/tar.cabal b/tar.cabal index d701345..559e1a2 100644 --- a/tar.cabal +++ b/tar.cabal @@ -83,7 +83,6 @@ test-suite properties build-depends: base, array, bytestring >= 0.10, - bytestring-handle, containers, deepseq, directory >= 1.2, @@ -93,6 +92,8 @@ test-suite properties tasty >= 0.10 && <1.6, tasty-quickcheck >= 0.8 && <0.11, time + if impl(ghc < 9.0) + build-depends: bytestring-handle < 0.2 hs-source-dirs: test @@ -127,4 +128,4 @@ benchmark bench containers, deepseq, time, - tasty-bench + tasty-bench < 0.4 diff --git a/test/Codec/Archive/Tar/Index/Tests.hs b/test/Codec/Archive/Tar/Index/Tests.hs index 5854d73..e862e80 100644 --- a/test/Codec/Archive/Tar/Index/Tests.hs +++ b/test/Codec/Archive/Tar/Index/Tests.hs @@ -16,7 +16,9 @@ module Codec.Archive.Tar.Index.Tests ( prop_valid, prop_serialise_deserialise, prop_serialiseSize, +#ifdef MIN_VERSION_bytestring_handle prop_index_matches_tar, +#endif prop_finalise_unfinalise, ) where @@ -48,7 +50,10 @@ import Data.Maybe import Data.Function (on) import Control.Exception (SomeException, try, throwIO) import Codec.Archive.Tar.Write as Tar + +#ifdef MIN_VERSION_bytestring_handle import qualified Data.ByteString.Handle as HBS +#endif -- Not quite the properties of a finite mapping because we also have lookups -- that result in completions. @@ -170,6 +175,7 @@ data SimpleTarArchive = SimpleTarArchive { instance Show SimpleTarArchive where show = show . simpleTarRaw +#ifdef MIN_VERSION_bytestring_handle prop_index_matches_tar :: SimpleTarArchive -> Property prop_index_matches_tar sta = ioProperty (try go >>= either (\e -> throwIO (e :: SomeException)) @@ -198,6 +204,7 @@ prop_index_matches_tar sta = throwIO $ userError "Entry mismatch" _otherwise -> throwIO $ userError "unexpected entry types" +#endif instance Arbitrary SimpleTarArchive where arbitrary = do diff --git a/test/Properties.hs b/test/Properties.hs index eb1476c..04c0a85 100644 --- a/test/Properties.hs +++ b/test/Properties.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + module Main where import qualified Codec.Archive.Tar.Index.Tests as Index @@ -45,7 +47,9 @@ main = testProperty "toList" Index.prop_toList, testProperty "serialise" Index.prop_serialise_deserialise, testProperty "size" Index.prop_serialiseSize, +#ifdef MIN_VERSION_bytestring_handle testProperty "matches tar" Index.prop_index_matches_tar, +#endif testProperty "unfinalise" Index.prop_finalise_unfinalise ] ]