From 5bc0b89e7042a2af655ee46be16eeefd9f8e86d5 Mon Sep 17 00:00:00 2001 From: quasicomputational Date: Sat, 26 May 2018 16:08:14 +0100 Subject: [PATCH 1/2] Test for indicentally-fixed #5195. I fixed this in passing with #5284, but let's add a test to make sure it stays fixed. The error message isn't perfect, but it's a lot better than failing silently! Closes #5195. --- cabal-testsuite/PackageTests/SDist/T5195/Main.hs | 1 + cabal-testsuite/PackageTests/SDist/T5195/cabal.out | 2 ++ cabal-testsuite/PackageTests/SDist/T5195/cabal.test.hs | 6 ++++++ cabal-testsuite/PackageTests/SDist/T5195/t5195.cabal | 10 ++++++++++ 4 files changed, 19 insertions(+) create mode 100644 cabal-testsuite/PackageTests/SDist/T5195/Main.hs create mode 100644 cabal-testsuite/PackageTests/SDist/T5195/cabal.out create mode 100644 cabal-testsuite/PackageTests/SDist/T5195/cabal.test.hs create mode 100644 cabal-testsuite/PackageTests/SDist/T5195/t5195.cabal diff --git a/cabal-testsuite/PackageTests/SDist/T5195/Main.hs b/cabal-testsuite/PackageTests/SDist/T5195/Main.hs new file mode 100644 index 00000000000..4233a67ecdd --- /dev/null +++ b/cabal-testsuite/PackageTests/SDist/T5195/Main.hs @@ -0,0 +1 @@ +main = putStrLn "hi" diff --git a/cabal-testsuite/PackageTests/SDist/T5195/cabal.out b/cabal-testsuite/PackageTests/SDist/T5195/cabal.out new file mode 100644 index 00000000000..d00b2befee3 --- /dev/null +++ b/cabal-testsuite/PackageTests/SDist/T5195/cabal.out @@ -0,0 +1,2 @@ +# cabal sdist +cabal: filepath wildcard './actually-a-directory' does not match any files. diff --git a/cabal-testsuite/PackageTests/SDist/T5195/cabal.test.hs b/cabal-testsuite/PackageTests/SDist/T5195/cabal.test.hs new file mode 100644 index 00000000000..a212609220d --- /dev/null +++ b/cabal-testsuite/PackageTests/SDist/T5195/cabal.test.hs @@ -0,0 +1,6 @@ +import Test.Cabal.Prelude +main = cabalTest $ do + tmpdir <- fmap testTmpDir getTestEnv + let fn = tmpdir "sources" + res <- fails $ cabal' "sdist" ["--list-sources=" ++ fn] + assertOutputContains "filepath wildcard './actually-a-directory' does not match any files" res diff --git a/cabal-testsuite/PackageTests/SDist/T5195/t5195.cabal b/cabal-testsuite/PackageTests/SDist/T5195/t5195.cabal new file mode 100644 index 00000000000..5d9a759dd71 --- /dev/null +++ b/cabal-testsuite/PackageTests/SDist/T5195/t5195.cabal @@ -0,0 +1,10 @@ +cabal-version: 2.2 +name: t5195 +version: 0 + +extra-source-files: + ./actually-a-directory + +executable foo + default-language: Haskell2010 + main-is: Main.hs From bf11a46f7e1b82859d92e71022ac010d95591b27 Mon Sep 17 00:00:00 2001 From: quasicomputational Date: Sat, 26 May 2018 16:18:03 +0100 Subject: [PATCH 2/2] Of course, git doesn't track empty directories. --- .../PackageTests/SDist/T5195/actually-a-directory/some-file | 1 + 1 file changed, 1 insertion(+) create mode 100644 cabal-testsuite/PackageTests/SDist/T5195/actually-a-directory/some-file diff --git a/cabal-testsuite/PackageTests/SDist/T5195/actually-a-directory/some-file b/cabal-testsuite/PackageTests/SDist/T5195/actually-a-directory/some-file new file mode 100644 index 00000000000..63af512c383 --- /dev/null +++ b/cabal-testsuite/PackageTests/SDist/T5195/actually-a-directory/some-file @@ -0,0 +1 @@ +Hello. \ No newline at end of file