Skip to content

Commit c8c841c

Browse files
committed
Add test
1 parent d985953 commit c8c841c

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/Bridges/bridge_optimizer.jl

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,6 +1492,35 @@ function test_issue_2817()
14921492
return
14931493
end
14941494

1495+
MOI.Utilities.@model(
1496+
Model2817b,
1497+
(),
1498+
(MOI.LessThan,),
1499+
(),
1500+
(),
1501+
(),
1502+
(MOI.ScalarAffineFunction,),
1503+
(),
1504+
()
1505+
);
1506+
1507+
function MOI.supports_constraint(
1508+
::Model2817b,
1509+
::Type{MOI.VariableIndex},
1510+
::Type{S},
1511+
) where {S<:MOI.AbstractScalarSet}
1512+
return false
1513+
end
1514+
1515+
function test_issue_2817b()
1516+
model = MOI.instantiate(Model2817b{Float64}; with_bridge_type = Float64)
1517+
y, _ = MOI.add_constrained_variables(model, MOI.Nonpositives(1))
1518+
MOI.delete(model, y)
1519+
@test !MOI.is_valid(model, y[1])
1520+
@test MOI.is_empty(model)
1521+
return
1522+
end
1523+
14951524
end # module
14961525

14971526
TestBridgeOptimizer.runtests()

0 commit comments

Comments
 (0)