Skip to content

Commit

Permalink
Re #8392: fix golden test by using notice verbosity in GenBounds
Browse files Browse the repository at this point in the history
The proper way to print stuff is not a naive `putStrLn`, but using one
of the methods from Distribution.Simple.Utils, like `notice verbosity`.
  • Loading branch information
andreasabel committed Aug 28, 2022
1 parent 0ca9469 commit 1784dfb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cabal-install/src/Distribution/Client/GenBounds.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import Distribution.Simple.PackageDescription
import Distribution.Simple.Program
( ProgramDb )
import Distribution.Simple.Utils
( tryFindPackageDesc )
( notice, tryFindPackageDesc )
import Distribution.System
( Platform )
import Distribution.Version
Expand Down Expand Up @@ -118,11 +118,11 @@ genBounds verbosity packageDBs repoCtxt comp platform progdb globalFlags freezeF

let padTo = maximum $ map (length . unPackageName . packageName) pkgs

if null thePkgs then putStrLn
if null thePkgs then notice verbosity
"Congratulations, all your dependencies have upper bounds!"
else do
putStrLn boundsNeededMsg
traverse_ (putStrLn . (++",") . showBounds padTo) thePkgs
notice verbosity boundsNeededMsg
traverse_ (notice verbosity . (++",") . showBounds padTo) thePkgs

depName :: Dependency -> String
depName (Dependency pn _ _) = unPackageName pn
Expand Down
1 change: 1 addition & 0 deletions cabal-testsuite/PackageTests/GenBounds/Issue6290/cabal.out
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# cabal gen-bounds
Resolving dependencies...
Congratulations, all your dependencies have upper bounds!

0 comments on commit 1784dfb

Please sign in to comment.