Skip to content

Commit

Permalink
adapt element tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Wout4 committed Jul 13, 2023
1 parent 8b2ae06 commit d1dbdff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions tests/test_expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,9 @@ def test_incomplete_func(self):

cons = (arr[i] == 1).implies(p)
m = cp.Model([cons, i == 5])
self.assertTrue(m.solve())
self.assertTrue(cons.value())
self.assertFalse(m.solve())
#index i is None (since previous model has no solutions) so the value of cons is also None.
self.assertIsNone(cons.value())

# div constraint
a,b = intvar(1,2,shape=2)
Expand Down
14 changes: 7 additions & 7 deletions tests/test_transf_reif.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ def test_reif_element(self):
# than the array range, needs a reified equality decomposition.
arr = cpm_array([0,1,2])

cases = [(-1,3,5), # idx.lb, idx.ub, cnt
(-1,2,4),
(-1,1,3),
(-1,0,2),
(0,3,4),
cases = [(-1,3,3), # idx.lb, idx.ub, cnt
(-1,2,3),
(-1,1,2),
(-1,0,1),
(0,3,3),
(0,2,3),
(0,1,2),
(1,2,2),
(1,3,3),
(2,3,2),
(1,3,2),
(2,3,1),
]

for (lb,ub,cnt) in cases:
Expand Down

0 comments on commit d1dbdff

Please sign in to comment.