File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed
Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -303,17 +303,22 @@ function _runtests(
303303 model_eltype = eltype,
304304 print_inner_model:: Bool = false ,
305305 cannot_unbridge:: Bool = false ,
306+ no_bridge_used:: Bool = false ,
306307)
307308 # Load model and bridge it
308309 inner = MOI. Utilities. UniversalFallback (MOI. Utilities. Model {model_eltype} ())
309310 model = _bridged_model (Bridge{eltype}, inner)
310311 input_fn (model)
312+ _check_bridged (model; no_bridge_used)
311313 final_touch (model)
312314 # Should be able to call final_touch multiple times.
313315 final_touch (model)
314316 if print_inner_model
315317 print (inner)
316318 end
319+ if no_bridge_used
320+ return
321+ end
317322 Test. @testset " Test outer bridged model appears like the input" begin # COV_EXCL_LINE
318323 test =
319324 MOI. Utilities. UniversalFallback (MOI. Utilities. Model {model_eltype} ())
@@ -512,6 +517,13 @@ function _general_bridge_tests(bridge::B) where {B<:AbstractBridge}
512517 return
513518end
514519
520+ function _check_bridged (model; no_bridge_used)
521+ unused = isempty (MOI. Bridges. Variable. bridges (model)) &&
522+ isempty (MOI. Bridges. Constraint. bridges (model)) &&
523+ isempty (MOI. Bridges. Objective. bridges (model))
524+ Test. @test unused == no_bridge_used
525+ end
526+
515527"""
516528 BridgeRequiresFiniteDomainError{
517529 B<:AbstractBridge,
Original file line number Diff line number Diff line change @@ -345,6 +345,7 @@ function test_runtests()
345345 [z, 2.0 * x * x] in Indicator{ACTIVATE_ON_ONE}(LessThan(2.0))
346346 z in ZeroOne()
347347 """ ,
348+ no_bridge_used = true ,
348349 )
349350 return
350351end
Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ function test_runtests()
104104 variables: x
105105 ::Float64: [x, x] in Zeros(2)
106106 """ ,
107+ no_bridge_used = true ,
107108 )
108109 # VectorAffineFunction
109110 MOI. Bridges. runtests (
You can’t perform that action at this time.
0 commit comments