-
Notifications
You must be signed in to change notification settings - Fork 701
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix up existing tests with multiline expectations
(cherry picked from commit 484ac9c) # Conflicts: # cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromComplex/cabal.out # cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromComplex/cabal.test.hs
- Loading branch information
1 parent
ead42eb
commit 1a4350a
Showing
8 changed files
with
157 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromComplex/cabal.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# check "using config from message" with URI imports | ||
# cabal v2-build | ||
# check project configuration with URI imports is listed in full and | ||
# check package directories and locations are reported in order |
43 changes: 43 additions & 0 deletions
43
cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromComplex/cabal.test.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import Test.Cabal.Prelude | ||
import Data.Function ((&)) | ||
|
||
main = cabalTest . recordMode RecordMarked $ do | ||
let log = recordHeader . pure | ||
|
||
log "checking \"using config from message\" with URI imports" | ||
out <- fails $ cabal' "v2-build" [ "all", "--dry-run", "--project-file=no-pkgs.project" ] | ||
|
||
-- Use assertRegex when the output is tainted by the temp directory, like | ||
-- this: | ||
-- | ||
-- When using configuration from: | ||
-- - /tmp/cabal-testsuite-282695/cabal.project | ||
-- - /tmp/cabal-testsuite-282695/2.config etc | ||
assertRegex | ||
"Project configuration with URI imports is listed in full" | ||
"When using configuration from:(\n|\r\n) \ | ||
\ .*no-pkgs\\.project(\n|\r\n) \ | ||
\ .*0\\.config(\n|\r\n) \ | ||
\ .*2\\.config(\n|\r\n) \ | ||
\ .*4\\.config(\n|\r\n) \ | ||
\ .*6\\.config(\n|\r\n) \ | ||
\ .*8\\.config(\n|\r\n) \ | ||
\ .*1\\.config(\n|\r\n) \ | ||
\ .*3\\.config(\n|\r\n) \ | ||
\ .*5\\.config(\n|\r\n) \ | ||
\ .*7\\.config(\n|\r\n) \ | ||
\ .*9\\.config(\n|\r\n) \ | ||
\ .*with-ghc\\.config(\n|\r\n) \ | ||
\ .*https://www.stackage.org/lts-21.25/cabal.config(\n|\r\n)" | ||
out | ||
|
||
log "checking that package directories and locations are reported in order" | ||
|
||
"The following errors occurred:\n\ | ||
\ - The package directory 'no-pkg-1' does not contain any .cabal file.\n\ | ||
\ - The package location 'no-pkg-2-dir' does not exist.\n\ | ||
\ - The package directory 'no-pkg-3' does not contain any .cabal file.\n\ | ||
\ - The package location 'no-pkg-4-dir' does not exist." | ||
& flip (assertOn multilineNeedleHaystack) out | ||
|
||
return () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters