Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re #7670: WIP: test case for #7248 #7702

Merged
merged 6 commits into from
Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cabal-testsuite/PackageTests/Get/T7248/cabal.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- This config file contains a bogus repository by intention.

repository x.y.z
url: http://x.y.z/
5 changes: 5 additions & 0 deletions cabal-testsuite/PackageTests/Get/T7248/cabal.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# cabal get
Warning: <ROOT>/cabal.config: Unrecognized stanza on line 3
Warning: The package list for 'x.y.z' does not exist. Run 'cabal update' to download it.
Error: cabal: There is no package named 'a-b-s-e-n-t'.
You may need to run 'cabal update' to get the latest list of available packages.
15 changes: 15 additions & 0 deletions cabal-testsuite/PackageTests/Get/T7248/cabal.test.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- 2021-10-06, issue #7248
--
-- Purpose of this test:
-- Make sure that ordinary user communication does not contain 'Show'ed internal structures.
--
-- This is a golden value test that reports the produced error message.
-- Needs to be checked manually whether it meets expectations.

import Test.Cabal.Prelude
main = cabalTest $
fails $
cabalG
[ "--config-file", "cabal.config" ]
"get"
[ "a-b-s-e-n-t" ]
10 changes: 9 additions & 1 deletion cabal-testsuite/src/Test/Cabal/Prelude.hs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,15 @@ cabalGArgs global_args cmd args input = do
-- overwritable
when (cmd == "v1-freeze") requireHasSourceCopy
let extra_args
| cmd `elem` ["v1-update", "outdated", "user-config", "man", "v1-freeze", "check"]
| cmd `elem`
[ "v1-update"
, "outdated"
, "user-config"
, "man"
, "v1-freeze"
, "check"
, "get", "unpack"
]
= [ ]

-- new-build commands are affected by testCabalProjectFile
Expand Down