From 9cc3a4783ef55514c12c9274cf0ffbf5015e51a3 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Sat, 21 Dec 2024 09:56:31 -0500 Subject: [PATCH] Add using configuration from to errors.expect.txt --- .../DedupUsingConfigFromComplex/cabal.out | 5 +-- .../DedupUsingConfigFromComplex/cabal.test.hs | 32 +++---------------- .../errors.expect.txt | 14 ++++++++ 3 files changed, 21 insertions(+), 30 deletions(-) diff --git a/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromComplex/cabal.out b/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromComplex/cabal.out index 437612a2eca..43a3f25acc2 100644 --- a/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromComplex/cabal.out +++ b/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromComplex/cabal.out @@ -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 diff --git a/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromComplex/cabal.test.hs b/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromComplex/cabal.test.hs index 0fb8d4e9504..6d4558761b1 100644 --- a/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromComplex/cabal.test.hs +++ b/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromComplex/cabal.test.hs @@ -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 () diff --git a/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromComplex/errors.expect.txt b/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromComplex/errors.expect.txt index db5a6a88854..93907eea807 100644 --- a/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromComplex/errors.expect.txt +++ b/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromComplex/errors.expect.txt @@ -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.