Commit 03644697 authored by Alexis Williams's avatar Alexis Williams
Browse files

Add test for base case

parent 5554817f
module Main (main) where
main :: IO ()
main = putStrLn "Hello, world!"
cabal-version: 2.2
name: deterministic
version: 0
executable dummy
default-language: Haskell2010
main-is: Main.hs
# cabal new-sdist
Wrote tarball sdist to <ROOT>/dist-newstyle/sdist/deterministic-0.tar.gz
\ No newline at end of file
import Test.Cabal.Prelude
import qualified Data.ByteString as BS
import qualified Crypto.Hash.SHA256 as SHA256
import System.FilePath
( (</>) )
main = cabalTest $ do
cabal "new-sdist" ["deterministic"]
env <- getTestEnv
let dir = testCurrentDir env
knownSdist = dir </> "deterministic-0.tar.gz"
mySdist = dir </> "dist-newstyle" </> "sdist" </> "deterministic-0.tar.gz"
known <- liftIO (BS.readFile knownSdist)
unknown <- liftIO (BS.readFile mySdist)
assertEqual "hashes didn't match for sdist" (SHA256.hash known) (SHA256.hash unknown)
......@@ -282,6 +282,7 @@ cabalG' global_args cmd args = do
| cmd `elem` ["v1-update", "outdated", "user-config", "manpage", "v1-freeze", "check"]
= [ ]
-- new-build commands are affected by testCabalProjectFile
| cmd == "new-sdist" = [ "--project-file", testCabalProjectFile env ]
| "new-" `isPrefixOf` cmd
= [ "--builddir", testDistDir env
, "--project-file", testCabalProjectFile env
......
......@@ -47,6 +47,7 @@ library
regex-tdfa,
temporary,
text,
cryptohash-sha256,
Cabal >= 2.3
ghc-options: -Wall -fwarn-tabs
if !os(windows)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment