@@ -37,6 +37,8 @@ function test_bounds()
3737 2.0 ,
3838 1.0 ,
3939 )
40+ @test ModelAnalyzer. variable (ret[], model) == y
41+ @test ModelAnalyzer. values (ret[]) == [2.0 , 1.0 ]
4042 #
4143 buf = IOBuffer ()
4244 ModelAnalyzer. summarize (
@@ -82,6 +84,9 @@ function test_integrality()
8284 2.9 ,
8385 MOI. Integer (),
8486 )
87+ @test ModelAnalyzer. variable (ret[], model) == y
88+ @test ModelAnalyzer. values (ret[]) == [2.2 , 2.9 ]
89+ @test ModelAnalyzer. set (ret[]) == MOI. Integer ()
8590 #
8691 buf = IOBuffer ()
8792 ModelAnalyzer. summarize (
@@ -129,6 +134,9 @@ function test_binary()
129134 0.8 ,
130135 MOI. ZeroOne (),
131136 )
137+ @test ModelAnalyzer. variable (ret[], model) == x
138+ @test ModelAnalyzer. values (ret[]) == [0.5 , 0.8 ]
139+ @test ModelAnalyzer. set (ret[]) == MOI. ZeroOne ()
132140 return
133141end
134142
@@ -150,6 +158,9 @@ function test_range()
150158 22.0 ,
151159 MOI. LessThan {Float64} (1.0 ),
152160 )
161+ @test ModelAnalyzer. constraint (ret[], model) == c
162+ @test ModelAnalyzer. values (ret[]) == [11.0 , 22.0 ]
163+ @test ModelAnalyzer. set (ret[]) == MOI. LessThan {Float64} (1.0 )
153164 #
154165 buf = IOBuffer ()
155166 ModelAnalyzer. summarize (
@@ -198,6 +209,9 @@ function test_range_neg()
198209 22.0 ,
199210 MOI. LessThan {Float64} (1.0 ),
200211 )
212+ @test ModelAnalyzer. constraint (ret[], model) == c
213+ @test ModelAnalyzer. values (ret[]) == [11.0 , 22.0 ]
214+ @test ModelAnalyzer. set (ret[]) == MOI. LessThan {Float64} (1.0 )
201215 return
202216end
203217
@@ -219,6 +233,9 @@ function test_range_equalto()
219233 3.0 ,
220234 MOI. EqualTo {Float64} (1.0 ),
221235 )
236+ @test ModelAnalyzer. constraint (ret[], model) == c
237+ @test ModelAnalyzer. values (ret[]) == [3.0 , 3.0 ]
238+ @test ModelAnalyzer. set (ret[]) == MOI. EqualTo {Float64} (1.0 )
222239 return
223240end
224241
@@ -240,6 +257,9 @@ function test_range_equalto_2()
240257 7.0 ,
241258 MOI. EqualTo {Float64} (1.0 ),
242259 )
260+ @test ModelAnalyzer. constraint (ret[], model) == c
261+ @test ModelAnalyzer. values (ret[]) == [7.0 , 7.0 ]
262+ @test ModelAnalyzer. set (ret[]) == MOI. EqualTo {Float64} (1.0 )
243263 return
244264end
245265
@@ -261,6 +281,9 @@ function test_range_greaterthan()
261281 22.0 ,
262282 MOI. GreaterThan {Float64} (100.0 ),
263283 )
284+ @test ModelAnalyzer. constraint (ret[], model) == c
285+ @test ModelAnalyzer. values (ret[]) == [11.0 , 22.0 ]
286+ @test ModelAnalyzer. set (ret[]) == MOI. GreaterThan {Float64} (100.0 )
264287 return
265288end
266289
@@ -282,6 +305,9 @@ function test_range_equalto_3()
282305 22.0 ,
283306 MOI. EqualTo {Float64} (100.0 ),
284307 )
308+ @test ModelAnalyzer. constraint (ret[], model) == c
309+ @test ModelAnalyzer. values (ret[]) == [11.0 , 22.0 ]
310+ @test ModelAnalyzer. set (ret[]) == MOI. EqualTo {Float64} (100.0 )
285311 return
286312end
287313
@@ -326,6 +352,9 @@ function test_iis()
326352 @test length (ret[]. constraint) == 2
327353 @test Set ([ret[]. constraint[1 ], ret[]. constraint[2 ]]) ==
328354 Set (JuMP. index .([c2, c1]))
355+ iis = ModelAnalyzer. constraints (ret[], model)
356+ @test length (iis) == 2
357+ @test Set (iis) == Set ([c2, c1])
329358 #
330359 buf = IOBuffer ()
331360 ModelAnalyzer. summarize (
@@ -388,6 +417,10 @@ function test_iis_multiple()
388417 @test JuMP. index (c2) in Set ([ret[]. constraint[1 ], ret[]. constraint[2 ]])
389418 @test Set ([ret[]. constraint[1 ], ret[]. constraint[2 ]]) ⊆
390419 Set (JuMP. index .([c3, c2, c1]))
420+ iis = ModelAnalyzer. constraints (ret[], model)
421+ @test length (iis) == 2
422+ @test Set (iis) ⊆ Set ([c3, c2, c1])
423+ @test c2 in iis
391424 return
392425end
393426
@@ -415,6 +448,9 @@ function test_iis_interval_right()
415448 @test length (ret[]. constraint) == 2
416449 @test Set ([ret[]. constraint[1 ], ret[]. constraint[2 ]]) ==
417450 Set (JuMP. index .([c2, c1]))
451+ iis = ModelAnalyzer. constraints (ret[], model)
452+ @test length (iis) == 2
453+ @test Set (iis) == Set ([c2, c1])
418454 return
419455end
420456
@@ -442,6 +478,9 @@ function test_iis_interval_left()
442478 @test length (ret[]. constraint) == 2
443479 @test Set ([ret[]. constraint[1 ], ret[]. constraint[2 ]]) ==
444480 Set (JuMP. index .([c2, c1]))
481+ iis = ModelAnalyzer. constraints (ret[], model)
482+ @test length (iis) == 2
483+ @test Set (iis) == Set ([c2, c1])
445484 return
446485end
447486
@@ -472,6 +511,9 @@ function test_iis_spare()
472511 @test length (ret[]. constraint) == 2
473512 @test Set ([ret[]. constraint[1 ], ret[]. constraint[2 ]]) ==
474513 Set (JuMP. index .([c2, c1]))
514+ iis = ModelAnalyzer. constraints (ret[], model)
515+ @test length (iis) == 2
516+ @test Set (iis) == Set ([c2, c1])
475517 return
476518end
477519
0 commit comments