Skip to content

Commit e3cbbb5

Browse files
committed
Simplify versions for doctests
1 parent abf29a1 commit e3cbbb5

File tree

1 file changed

+15
-15
lines changed
  • cabal-install-solver/src/Distribution/Solver/Modular

1 file changed

+15
-15
lines changed

cabal-install-solver/src/Distribution/Solver/Modular/Message.hs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -241,17 +241,17 @@ data IsOrVs = Is [POption] | Vs [Ver] deriving Show
241241
-- instances if any of the options is linked (installed). Singleton lists or
242242
-- empty lists are always converted to Is.
243243
-- >>> tryVs [v0, v1]
244-
-- Vs [mkVersion [1,0,0],mkVersion [1,0,1]]
244+
-- Vs [mkVersion [0],mkVersion [1]]
245245
-- >>> tryVs [v0]
246-
-- Is [POption (I (mkVersion [1,0,0]) InRepo) Nothing]
246+
-- Is [POption (I (mkVersion [0]) InRepo) Nothing]
247247
-- >>> tryVs [i0, i1]
248-
-- Is [POption (I (mkVersion [1,0,0]) (Inst (UnitId "foo-1.0.0-inplace"))) Nothing,POption (I (mkVersion [1,0,1]) (Inst (UnitId "foo-1.0.1-inplace"))) Nothing]
248+
-- Is [POption (I (mkVersion [0]) (Inst (UnitId "foo-0-inplace"))) Nothing,POption (I (mkVersion [1]) (Inst (UnitId "foo-1-inplace"))) Nothing]
249249
-- >>> tryVs [i0, v1]
250-
-- Is [POption (I (mkVersion [1,0,0]) (Inst (UnitId "foo-1.0.0-inplace"))) Nothing,POption (I (mkVersion [1,0,1]) InRepo) Nothing]
250+
-- Is [POption (I (mkVersion [0]) (Inst (UnitId "foo-0-inplace"))) Nothing,POption (I (mkVersion [1]) InRepo) Nothing]
251251
-- >>> tryVs [v0, i1]
252-
-- Is [POption (I (mkVersion [1,0,0]) InRepo) Nothing,POption (I (mkVersion [1,0,1]) (Inst (UnitId "foo-1.0.1-inplace"))) Nothing]
252+
-- Is [POption (I (mkVersion [0]) InRepo) Nothing,POption (I (mkVersion [1]) (Inst (UnitId "foo-1-inplace"))) Nothing]
253253
-- >>> tryVs [i0]
254-
-- Is [POption (I (mkVersion [1,0,0]) (Inst (UnitId "foo-1.0.0-inplace"))) Nothing]
254+
-- Is [POption (I (mkVersion [0]) (Inst (UnitId "foo-0-inplace"))) Nothing]
255255
-- >>> tryVs []
256256
-- Is []
257257
tryVs :: [POption] -> IsOrVs
@@ -266,15 +266,15 @@ tryVs xs
266266
-- | Shows a list of versions in a human-friendly way, abbreviated. Shows a list
267267
-- of instances in full.
268268
-- >>> showIsOrVs fooQPN $ tryVs [v0, v1]
269-
-- "foo; 1.0.1, 1.0.0"
269+
-- "foo; 1, 0"
270270
-- >>> showIsOrVs fooQPN $ tryVs [v0]
271-
-- "foo-1.0.0"
271+
-- "foo-0"
272272
-- >>> showIsOrVs fooQPN $ tryVs [i0, i1]
273-
-- "foo-1.0.1/installed-inplace, foo-1.0.0/installed-inplace"
273+
-- "foo-1/installed-inplace, foo-0/installed-inplace"
274274
-- >>> showIsOrVs fooQPN $ tryVs [i0, v1]
275-
-- "foo-1.0.1, foo-1.0.0/installed-inplace"
275+
-- "foo-1, foo-0/installed-inplace"
276276
-- >>> showIsOrVs fooQPN $ tryVs [v0, i1]
277-
-- "foo-1.0.1/installed-inplace, foo-1.0.0"
277+
-- "foo-1/installed-inplace, foo-0"
278278
-- >>> showIsOrVs fooQPN $ tryVs []
279279
-- "unexpected empty list of versions"
280280
showIsOrVs :: QPN -> IsOrVs -> String
@@ -347,7 +347,7 @@ showConflictingDep (ConflictingDep dr (PkgComponent qpn comp) ci) =
347347
-- >>> import Distribution.Types.Version
348348
-- >>> import Distribution.Types.UnitId
349349
-- >>> let fooQPN = Q (PackagePath DefaultNamespace QualToplevel) (mkPackageName "foo")
350-
-- >>> let v0 = POption (I (mkVersion [1,0,0]) InRepo) Nothing
351-
-- >>> let v1 = POption (I (mkVersion [1,0,1]) InRepo) Nothing
352-
-- >>> let i0 = POption (I (mkVersion [1,0,0]) (Inst $ mkUnitId "foo-1.0.0-inplace")) Nothing
353-
-- >>> let i1 = POption (I (mkVersion [1,0,1]) (Inst $ mkUnitId "foo-1.0.1-inplace")) Nothing
350+
-- >>> let v0 = POption (I (mkVersion [0]) InRepo) Nothing
351+
-- >>> let v1 = POption (I (mkVersion [1]) InRepo) Nothing
352+
-- >>> let i0 = POption (I (mkVersion [0]) (Inst $ mkUnitId "foo-0-inplace")) Nothing
353+
-- >>> let i1 = POption (I (mkVersion [1]) (Inst $ mkUnitId "foo-1-inplace")) Nothing

0 commit comments

Comments
 (0)