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
9 cabal
"v2-sdist" ["deterministic"]
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
)