Skip to content

Commit 575f141

Browse files
committed
Add test for ^>=1 constraint
1 parent cf73447 commit 575f141

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

  • cabal-install/tests/UnitTests/Distribution/Solver/Modular

cabal-install/tests/UnitTests/Distribution/Solver/Modular/Solver.hs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@ tests =
266266
-- >=1
267267
ge1 = C.orLaterVersion $ C.mkVersion [1]
268268

269+
-- \^>=1
270+
ce1 = C.majorBoundVersion $ mkSimpleVersion 1
271+
269272
-- TODO: Find out why <=1 is not the same as <=1.0.0
270273
-- <=1
271274
le1 = C.orEarlierVersion $ C.mkVersion [1, 0, 0]
@@ -320,6 +323,12 @@ tests =
320323
, mkConstraint "C" le1
321324
]
322325

326+
-- B ^>=1, C <=1
327+
celeConstraints =
328+
[ mkConstraint "B" ce1
329+
, mkConstraint "C" ce1
330+
]
331+
323332
-- B <=1 && >=1, C <=1 && >=1
324333
legeConstraints =
325334
[ mkConstraint "B" lege1
@@ -362,6 +371,10 @@ tests =
362371
(mkTest db17 "goal A with B >=1, C <=1" ["A"] solveABC)
363372
{ testConstraints = geleConstraints
364373
}
374+
, runTest . whenAll $
375+
(mkTest db17 "goal A with B ^>=1, C ^>=1" ["A"] solveABC)
376+
{ testConstraints = celeConstraints
377+
}
365378
, runTest . whenAll $
366379
(mkTest db17 "goal A with B <=1 && >=1, C <=1 && >=1" ["A"] solveABC)
367380
{ testConstraints = legeConstraints
@@ -444,6 +457,10 @@ tests =
444457
(mkTest db17 "goal A with B >=1, C <=1" ["A"] eqFailure)
445458
{ testConstraints = geleConstraints
446459
}
460+
, runTest . whenEq $
461+
(mkTest db17 "goal A with B ^>=1, C ^>=1" ["A"] eqFailure)
462+
{ testConstraints = celeConstraints
463+
}
447464
, runTest . whenEq $
448465
(mkTest db17 "goal A with B <=1 && >=1, C <=1 && >=1" ["A"] eqFailure)
449466
{ testConstraints = legeConstraints

0 commit comments

Comments
 (0)