(cabal check) Add "No internal name clash" test
[cabal.git] / cabal-testsuite / PackageTests / NewSdist / DeterministicTrivial / deterministic.test.hs
blob64b0a329a95288a9b5420dda345a5ab1c649abd8
1 import Test.Cabal.Prelude
2 import qualified Data.ByteString as BS
3 import qualified Data.ByteString.Base16 as BS16
4 import qualified Crypto.Hash.SHA256 as SHA256
5 import System.FilePath
6 ( (</>) )
8 main = cabalTest $ do
9 cabal "v2-sdist" ["deterministic"]
10 env <- getTestEnv
11 let dir = testCurrentDir env
12 knownSdist = dir </> "deterministic-0.tar.gz"
13 mySdist = dir </> "dist-newstyle" </> "sdist" </> "deterministic-0.tar.gz"
15 -- This helps to understand why this test fails, if it does:
17 -- shell "tar" ["-tzvf", knownSdist]
18 -- shell "tar" ["-tzvf", mySdist]
21 known <- liftIO (BS.readFile knownSdist)
22 unknown <- liftIO (BS.readFile mySdist)
24 assertEqual "hashes didn't match for sdist" (BS16.encode $ SHA256.hash known) (BS16.encode $ SHA256.hash unknown)