-
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.
- Add else.project test - Use normalizeWindowsOutput - Add a changelog entry - Update expectation - Use concatOutput on needle - Include output - Align lines - Show modified output - Apply concatOutput to the needle - Show start and end of lines with ASCII ^ and $h - Can't print pilcrow so use grep char for marking end of line - Marking the start of line distinguishes "expected" intro from its content too, same for "output" - Use \n in multiline string expectation
- Loading branch information
1 parent
dd21a74
commit 8a5a5b4
Showing
7 changed files
with
104 additions
and
15 deletions.
There are no files selected for viewing
3 changes: 0 additions & 3 deletions
3
cabal-testsuite/PackageTests/ConditionalAndImport/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
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/ProjectImport/ParseErrorProvenance/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,2 @@ | ||
# cabal v2-build | ||
Warning: <ROOT>/else.project, else.project: Unrecognized section '_' on line 3 |
15 changes: 15 additions & 0 deletions
15
cabal-testsuite/PackageTests/ProjectImport/ParseErrorProvenance/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,15 @@ | ||
import Test.Cabal.Prelude | ||
|
||
main = cabalTest . recordMode RecordMarked $ do | ||
let log = recordHeader . pure | ||
|
||
outElse <- fails $ cabal' "v2-build" [ "all", "--dry-run", "--project-file=else.project" ] | ||
assertOutputContainsOn unConcatOutput unConcatOutput concatOutput | ||
(concatOutput "When using configuration from:\n\ | ||
\ - else.project\n\ | ||
\ - dir-else/else.config\n\ | ||
\The following errors occurred:\n\ | ||
\ - The package location 'no-pkg-here' does not exist.") | ||
outElse | ||
|
||
return () |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/ProjectImport/ParseErrorProvenance/dir-else/else.config
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 @@ | ||
if false | ||
else | ||
_ | ||
packages: no-pkg-here |
1 change: 1 addition & 0 deletions
1
cabal-testsuite/PackageTests/ProjectImport/ParseErrorProvenance/else.project
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 @@ | ||
import: dir-else/else.config |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
synopsis: Deduplicate path separator duplicates | ||
packages: [cabal-install-solver] | ||
prs: 10646 | ||
issues: 10645 | ||
--- | ||
|
||
The "using configuration from" message no longer has duplicates on Windows when | ||
the `cabal.project` uses forward slashes for its imports but the message reports | ||
imports with backslashes. | ||
|
||
```diff | ||
$ cat cabal.project | ||
import: dir-a/b.config | ||
|
||
$ cabal build all --dry-run | ||
... | ||
When using configuration from: | ||
- - dir-a/b.config | ||
- dir-a\b.config | ||
- cabal.project | ||
``` | ||
|
||
## Ord ProjectConfigPath Instance Changes | ||
|
||
For comparison purposes, path separators are normalized to the @buildOS@ | ||
platform's path separator. | ||
|
||
```haskell | ||
-- >>> let abFwd = ProjectConfigPath $ "a/b.config" :| [] | ||
-- >>> let abBwd = ProjectConfigPath $ "a\\b.config" :| [] | ||
-- >>> compare abFwd abBwd | ||
-- EQ | ||
``` |