Skip to content

Commit

Permalink
Add using configuration from to errors.expect.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Dec 21, 2024
1 parent a70a062 commit 9cc3a47
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# checking "using config from message" with URI imports
# check "using config from message" with URI imports
# cabal v2-build
# checking that package directories and locations are reported in order
# check project configuration with URI imports is listed in full and
# check package directories and locations are reported in order
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,12 @@ import Data.Function ((&))
main = cabalTest . recordMode RecordMarked $ do
let log = recordHeader . pure

log "checking \"using config from message\" with URI imports"
log "check \"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 "check project configuration with URI imports is listed in full and"
log "check package directories and locations are reported in order"

log "checking that package directories and locations are reported in order"

readVerbatimFile "errors.expect.txt"
>>= flip (assertOn multilineNeedleHaystack) out
readVerbatimFile "errors.expect.txt" >>= flip (assertOn multilineNeedleHaystack) out

return ()
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
When using configuration from:
- no-pkgs.project
- 0.config
- 2.config
- 4.config
- 6.config
- 8.config
- cfg/1.config
- cfg/3.config
- cfg/5.config
- cfg/7.config
- cfg/9.config
- with-ghc.config
- https://www.stackage.org/lts-21.25/cabal.config
The following errors occurred:
- The package directory 'no-pkg-1' does not contain any .cabal file.
- The package location 'no-pkg-2-dir' does not exist.
Expand Down

0 comments on commit 9cc3a47

Please sign in to comment.