-
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 expectNeedleInHaystack field to NeedleHaystack - Remove 3 assert*Contains functions - Add TxContains record - Apply the txBwd transformations before display - Add displayHaystack field - Switch to using <EOL> as the marker - Sort language pragmas - Use ++ rather than cons with reversals - Rerun ParseErrorProvenance test - Add doctests for single line strings - Read exected multiline string from file - Use lineBreaksToSpaces - Add module Test.Cabal.NeedleHaystack - Redo ConditionalAndImport with multiline expectations - Add test of string expectation start and end marking - Rename encodeLf and decodeLfMarkLines - Rename original concatOutput to lineBreaksToSpaces - Add assertOutputContainsWrapped - Use multiline and wrapped assertions - Satisfy fix-whitespace - DedupUsingConfigFromComplex multiline assertion - Remove redundant tests that fail on Windows - Use normalizeWindowsOutput in ConditionalAndImport - Forward conversion applied twice by mistake - Easier diff when assertOn follows assertOutputContains
- Loading branch information
1 parent
8a5a5b4
commit d2c6a43
Showing
13 changed files
with
280 additions
and
187 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
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
8 changes: 8 additions & 0 deletions
8
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 |
---|---|---|
@@ -1,2 +1,10 @@ | ||
# cabal v2-build | ||
Warning: <ROOT>/else.project, else.project: Unrecognized section '_' on line 3 | ||
# Multiline string marking: | ||
# ^When using configuration from:$ | ||
# ^ - else.project$ | ||
# ^ - dir-else/else.config$ | ||
# ^The following errors occurred:$ | ||
# ^ - The package location 'no-pkg-here' does not exist.$ | ||
# Pseudo multiline string marking: | ||
# ^When using configuration from: - else.project - dir-else/else.config The following errors occurred: - The package location 'no-pkg-here' does not exist.$ |
27 changes: 20 additions & 7 deletions
27
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 |
---|---|---|
@@ -1,15 +1,28 @@ | ||
import Test.Cabal.Prelude | ||
import System.Directory | ||
|
||
main = cabalTest . recordMode RecordMarked $ do | ||
let log = recordHeader . pure | ||
cwd <- liftIO getCurrentDirectory | ||
env <- getTestEnv | ||
let testDir = testCurrentDir env | ||
liftIO . putStrLn $ "Current working directory: " ++ cwd | ||
msg <- liftIO . readFile $ testDir </> "msg.txt" | ||
|
||
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 | ||
|
||
let msgSingle = lineBreaksToSpaces msg | ||
|
||
log "Multiline string marking:" | ||
mapM_ log (lines . decodeLfMarkLines $ encodeLf msg) | ||
|
||
log "Pseudo multiline string marking:" | ||
mapM_ log (lines . decodeLfMarkLines $ encodeLf msgSingle) | ||
|
||
assertOn multilineNeedleHaystack msg outElse | ||
assertOn multilineNeedleHaystack{expectNeedleInHaystack = False} msgSingle outElse | ||
|
||
assertOutputDoesNotContain msg outElse | ||
assertOutputDoesNotContain msgSingle outElse | ||
|
||
return () |
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/ProjectImport/ParseErrorProvenance/msg.txt
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,5 @@ | ||
When using configuration from: | ||
- else.project | ||
- dir-else/else.config | ||
The following errors occurred: | ||
- The package location 'no-pkg-here' does not exist. |
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
Oops, something went wrong.