Skip to content

Commit

Permalink
add more (failing) tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tias committed Nov 29, 2023
1 parent 74803bb commit b313c69
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test_pysat_cardinality.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,27 @@ def test_pysat_linear_other(self):
for expression in expressions:
cp.Model(expression).solve("pysat")

def test_pysat_oob(self):

def test_encode_pb_oob(self):
self.assertTrue(len(self.bv) == 3)
# test out of bounds (meaningless) thresholds
expressions = [
sum(self.bv) <= 5, # true
sum(self.bv) <= 3, # true
sum(self.bv) <= -2, # false
sum(self.bv) <= 0, # undecided

sum(self.bv) >= -2, # true
sum(self.bv) >= 0, # true
sum(self.bv) >= 5, # false
sum(self.bv) >= 3, # undecided
]

## check all types of linear constraints are handled
for expression in expressions:
Model(expression).solve("pysat")

def test_pysat_different(self):

differrent = cp.Model(
Expand Down

0 comments on commit b313c69

Please sign in to comment.