Skip to content

Commit 522bec9

Browse files
committed
Add tests
1 parent 5181892 commit 522bec9

File tree

23 files changed

+634
-216
lines changed

23 files changed

+634
-216
lines changed

cabal-install-solver/src/Distribution/Solver/Types/SourcePackage.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{-# LANGUAGE DeriveGeneric #-}
2+
{-# LANGUAGE DeriveFunctor #-}
23
{-# LANGUAGE DeriveDataTypeable #-}
4+
35
module Distribution.Solver.Types.SourcePackage
46
( PackageDescriptionOverride
57
, SourcePackage(..)
@@ -25,7 +27,7 @@ data SourcePackage loc = SourcePackage
2527
, srcpkgSource :: loc
2628
, srcpkgDescrOverride :: PackageDescriptionOverride
2729
}
28-
deriving (Eq, Show, Generic, Typeable)
30+
deriving (Eq, Show, Functor, Generic, Typeable)
2931

3032
instance Binary loc => Binary (SourcePackage loc)
3133
instance Structured loc => Structured (SourcePackage loc)

cabal-install/src/Distribution/Client/ProjectConfig/Legacy.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,23 +1286,23 @@ legacyProjectConfigFieldDescrs :: ConstraintSource -> [FieldDescr LegacyProjectC
12861286
legacyProjectConfigFieldDescrs constraintSrc =
12871287
[ newLineListField
12881288
"packages"
1289-
(pretty . fmap (Disp.text . renderPackageLocationToken))
1289+
(Disp.text . renderPackageLocationToken . constraintPackage)
12901290
( (\pkg -> WithConstraintSource{constraintPackage = pkg, constraintConstraint = constraintSrc})
12911291
`fmap` parsePackageLocationTokenQ
12921292
)
12931293
legacyPackages
12941294
(\v flags -> flags{legacyPackages = v})
12951295
, newLineListField
12961296
"optional-packages"
1297-
(pretty . fmap (Disp.text . renderPackageLocationToken))
1297+
(Disp.text . renderPackageLocationToken . constraintPackage)
12981298
( (\pkg -> WithConstraintSource{constraintPackage = pkg, constraintConstraint = constraintSrc})
12991299
`fmap` parsePackageLocationTokenQ
13001300
)
13011301
legacyPackagesOptional
13021302
(\v flags -> flags{legacyPackagesOptional = v})
13031303
, commaNewLineListFieldParsec
13041304
"extra-packages"
1305-
pretty
1305+
(pretty . constraintPackage)
13061306
( (\pkg -> WithConstraintSource{constraintPackage = pkg, constraintConstraint = constraintSrc})
13071307
`fmap` parsec
13081308
)
@@ -1424,15 +1424,15 @@ legacySharedConfigFieldDescrs constraintSrc =
14241424
. addFields
14251425
[ commaNewLineListFieldParsec
14261426
"constraints"
1427-
pretty
1427+
(pretty . constraintPackage)
14281428
( (\constraint -> WithConstraintSource{constraintPackage = constraint, constraintConstraint = constraintSrc})
14291429
`fmap` parsec
14301430
)
14311431
configExConstraints
14321432
(\v conf -> conf{configExConstraints = v})
14331433
, commaNewLineListFieldParsec
14341434
"preferences"
1435-
pretty
1435+
(pretty . constraintPackage)
14361436
( (\preference -> WithConstraintSource{constraintPackage = preference, constraintConstraint = constraintSrc})
14371437
`fmap` parsec
14381438
)

0 commit comments

Comments
 (0)