Skip to content

Commit 0e7ad1d

Browse files
Rudimentary test for sdist --list-sources.
1 parent b58b315 commit 0e7ad1d

File tree

8 files changed

+30
-0
lines changed

8 files changed

+30
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
main = return ()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blah
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blah
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blah
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
cabal-version: 2.2
2+
name: list-sources
3+
version: 0
4+
data-dir: data
5+
data-files: blah/*.dat
6+
extra-source-files: extra-src/blah/*.html
7+
extra-doc-files: extra-doc/blah/*.tex
8+
9+
executable dummy
10+
default-language: Haskell2010
11+
main-is: Main.hs
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# cabal sdist
2+
List of package sources written to file '<TMPDIR>/sources'
3+
List of package sources written to file '<TMPDIR>/sources'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Setup sdist
2+
List of package sources written to file '<TMPDIR>/sources'
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import System.FilePath (normalise)
2+
import Test.Cabal.Prelude
3+
main = setupTest $ do
4+
tmpdir <- fmap testTmpDir getTestEnv
5+
let fn = tmpdir </> "sources"
6+
setup "sdist" ["--list-sources=" ++ fn]
7+
-- --list-sources outputs with slashes on posix and backslashes on Windows. 'normalise' converts our needle to the necessary format.
8+
assertFileDoesContain fn $ normalise "data/blah/a.dat"
9+
assertFileDoesContain fn $ normalise "extra-src/blah/a.html"
10+
assertFileDoesContain fn $ normalise "extra-doc/blah/a.tex"

0 commit comments

Comments
 (0)