Skip to content

Commit 87e29a8

Browse files
author
Kwesi Rutledge
committed
Added todos for other constraint types
1 parent 3de3a30 commit 87e29a8

File tree

4 files changed

+23
-13
lines changed

4 files changed

+23
-13
lines changed

symbolic/matrix_constraint.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,17 @@ func (mc MatrixConstraint) ImpliesThisIsAlsoSatisfied(other Constraint) bool {
259259
}
260260
}
261261
}
262+
case VectorConstraint:
263+
// TODO: Implement more advanced implication checks.
264+
return false
265+
case MatrixConstraint:
266+
// TODO: Implement more advanced implication checks.
267+
return false
262268
default:
263269
// Other types of constraints are not currently supported.
264-
return false
270+
panic(
271+
fmt.Errorf("implication checking between MatrixConstraint and %T is not currently supported", other),
272+
)
265273
}
266274

267275
// If no avenues for implication were found, return false.

symbolic/scalar_constraint.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,12 @@ func (sc ScalarConstraint) ImpliesThisIsAlsoSatisfied(other Constraint) bool {
433433
panic("unreachable code reached in ScalarConstraint.ImpliesThisIsAlsoSatisfied")
434434
}
435435
}
436+
case VectorConstraint:
437+
// TODO: Implement more advanced implication checks.
438+
return false
439+
case MatrixConstraint:
440+
// TODO: Implement more advanced implication checks.
441+
return false
436442
default:
437443
// Other types of constraints are not currently supported.
438444
panic(

symbolic/vector_constraint.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,12 @@ func (vc VectorConstraint) ImpliesThisIsAlsoSatisfied(other Constraint) bool {
390390
return true
391391
}
392392
}
393+
case VectorConstraint:
394+
// TODO: Implement more advanced implication checks.
395+
return false
396+
case MatrixConstraint:
397+
// TODO: Implement more advanced implication checks.
398+
return false
393399
default:
394400
// Other types of constraints are not currently supported.
395401
panic(

testing/symbolic/vector_constraint_test.go

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,20 +1342,10 @@ func TestVectorConstraint_ImpliesThisIsAlsoSatisfied3(t *testing.T) {
13421342
}
13431343

13441344
// Test
1345-
defer func() {
1346-
r := recover()
1347-
if r == nil {
1348-
t.Errorf(
1349-
"Expected vc.ImpliesThisIsAlsoSatisfied() to panic; received \"%v\"",
1350-
r,
1351-
)
1352-
}
1353-
}()
1354-
1355-
result := vc.ImpliesThisIsAlsoSatisfied(vc2)
1345+
result := vc.ImpliesThisIsAlsoSatisfied(vc2) // TODO: Fix this test to return true
13561346
if result {
13571347
t.Errorf(
1358-
"Expected vc.ImpliesThisIsAlsoSatisfied() to return false; received true",
1348+
"Expected vc.ImpliesThisIsAlsoSatisfied() to return true; received false",
13591349
)
13601350
}
13611351
}

0 commit comments

Comments
 (0)