Skip to content

Commit

Permalink
Add UntrimmedImport tests
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Dec 9, 2024
1 parent 7ef7c23 commit 0f1a81b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cabal-testsuite/PackageTests/UntrimmedImport/cabal.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# checking project import with trailing space
# cabal v2-build
Error: [Cabal-7090]
Error parsing project file <ROOT>/trailing-space.project:
import has whitespace;
'https://www.stackage.org/nightly-2024-12-05/cabal.config '
imported by: trailing-space.project
# checking project import with tabs and spaces
# cabal v2-build
Error: [Cabal-7090]
Error parsing project file <ROOT>/tabs-and-spaces.project:
import has whitespace;
'https://www.stackage.org/nightly-2024-12-05/cabal.config '
imported by: tabs-and-spaces.project
12 changes: 12 additions & 0 deletions cabal-testsuite/PackageTests/UntrimmedImport/cabal.test.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Test.Cabal.Prelude

main = cabalTest . recordMode RecordMarked $ do
let log = recordHeader . pure

log "checking project import with trailing space"
trailing <- fails $ cabal' "v2-build" [ "--project-file=trailing-space.project" ]
assertOutputContains "import has whitespace" trailing
assertOutputContains "'https://www.stackage.org/nightly-2024-12-05/cabal.config '" trailing

log "checking project import with tabs and spaces"
fails $ cabal "v2-build" [ "--project-file=tabs-and-spaces.project" ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
optional-packages: .
import: https://www.stackage.org/nightly-2024-12-05/cabal.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
optional-packages: .
import: https://www.stackage.org/nightly-2024-12-05/cabal.config

0 comments on commit 0f1a81b

Please sign in to comment.