Skip to content

Commit 2930ffc

Browse files
committed
✅ Add test
1 parent 0422fba commit 2930ffc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/bridge.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,21 @@ MOI.supports_constraint(::ModelNoVAFinSOC{Float64},
167167
::Type{MOI.VectorAffineFunction{Float64}},
168168
::Type{MOI.SecondOrderCone}) = false
169169

170+
# Model supporting nothing
171+
MOIU.@model NothingModel () () () () () () () ()
172+
170173
@testset "LazyBridgeOptimizer" begin
174+
@testset "Unsupported constraint with cycles" begin
175+
# Test that `supports_constraint` works correctly when it is not
176+
# supported but the bridges forms a cycle
177+
mock = MOIU.MockOptimizer(NothingModel{Float64}())
178+
bridged = MOIB.full_bridge_optimizer(mock, Float64)
179+
@test !MOI.supports_constraint(
180+
bridged, MOI.SingleVariable, MOI.GreaterThan{Float64})
181+
@test !MOI.supports_constraint(
182+
bridged, MOI.VectorAffineFunction{Float64}, MOI.Nonpositives)
183+
end
184+
171185
mock = MOIU.MockOptimizer(NoRSOCModel{Float64}())
172186
bridged_mock = MOIB.LazyBridgeOptimizer(
173187
mock, MOIB.AllBridgedConstraints{Float64}())

0 commit comments

Comments
 (0)