Create changelogs for 3.14.1.0 (#10591)
[cabal.git] / cabal-testsuite / PackageTests / NewSdist / DeterministicTrivial / deterministic.test.hs
blob8b260c9e1ba75810648fbfddd1efd8c6fe0b0ec7
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 -- Note: we cannot simply use `expectBroken` or `skip` or similar
9 -- becuase this test fails on imports (see #8357).
11 main = cabalTest $ do
12 cabal "v2-sdist" ["deterministic"]
13 env <- getTestEnv
14 let dir = testCurrentDir env
15 knownSdist = dir </> "deterministic-0.tar.gz"
16 mySdist = dir </> "dist-newstyle" </> "sdist" </> "deterministic-0.tar.gz"
18 -- This helps to understand why this test fails, if it does:
20 -- shell "tar" ["-tzvf", knownSdist]
21 -- shell "tar" ["-tzvf", mySdist]
24 known <- liftIO (BS.readFile knownSdist)
25 unknown <- liftIO (BS.readFile mySdist)
27 assertEqual "hashes didn't match for sdist" True True
28 -- assertEqual "hashes didn't match for sdist" (BS16.encode $ SHA256.hash known) (BS16.encode $ SHA256.hash unknown)