Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions src/Bridges/Bridges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,10 @@ function _test_structural_identical(
Test.@test (F, S) in b_constraint_types || MOI.get(a, attr) == 0
end
for (F, S) in b_constraint_types
@test haskey(constraints, (F, S))
# Check that the same number of constraints are present
attr = MOI.NumberOfConstraints{F,S}()
if !haskey(constraints, (F, S))
# Constraint is reported in `b`, but not in `a`. Check that there
# are no actual constraints in `b`.
Test.@test MOI.get(b, attr) == 0
continue
else
Test.@test MOI.get(a, attr) == MOI.get(b, attr)
end
Test.@test MOI.get(a, attr) == MOI.get(b, attr)
# Check that supports_constraint is implemented
Test.@test MOI.supports_constraint(b, F, S)
# Check that each function in `b` matches a function in `a`
Expand Down Expand Up @@ -402,9 +396,7 @@ function _test_delete(Bridge, model, inner)
MOI.delete.(model, MOI.get(model, MOI.ListOfConstraintIndices{F,S}()))
end
# * So now there should be no constraints in the problem
for (F, S) in MOI.get(inner, MOI.ListOfConstraintTypesPresent())
Test.@test MOI.get(inner, MOI.NumberOfConstraints{F,S}()) == 0
end
@test isempty(MOI.get(inner, MOI.ListOfConstraintTypesPresent()))
# * And there should be the same number of variables
attr = MOI.NumberOfVariables()
Test.@test MOI.get(inner, attr) == MOI.get(model, attr)
Expand Down
3 changes: 2 additions & 1 deletion test/Bridges/Constraint/AllDifferentToCountDistinctBridge.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ function test_runtests_VectorOfVariables()
y <= 3.0
z == 2.0
n == 3.0
""",
""";
print_inner_model = true,
)
return
end
Expand Down
Loading