Un-ignore .bat files
[cabal.git] / cabal-testsuite / PackageTests / NewSdist / DeterministicTrivial / deterministic.test.hs
blob67c2944b39cb728b74f9364f9c8d3def5fab54bb
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 skipIf "#8356" True -- bogus, just to indicate that the test is skipped
28 assertEqual "hashes didn't match for sdist" True True
29 -- assertEqual "hashes didn't match for sdist" (BS16.encode $ SHA256.hash known) (BS16.encode $ SHA256.hash unknown)