Skip to content

Commit 8b4b3ca

Browse files
authored
Fix requires for test_model_Name_VariableName_ConstraintName (#2349)
1 parent cc50e67 commit 8b4b3ca

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Test/test_model.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ function test_model_Name_VariableName_ConstraintName(
316316
for yi in y
317317
@test MOI.get(model, MOI.VariableName(), yi) == ""
318318
end
319-
@test MOI.get(model, MOI.ConstraintName(), cy) == ""
320319
MOI.set(model, MOI.VariableName(), v[1], "")
321320
MOI.set(model, MOI.VariableName(), v[2], "") # Shouldn't error with duplicate empty name
322321
MOI.set(model, MOI.VariableName(), x, "")
@@ -363,14 +362,14 @@ function test_model_Name_VariableName_ConstraintName(
363362
MOI.ScalarAffineFunction(MOI.ScalarAffineTerm.(T[-1, 1], v), T(0)),
364363
MOI.EqualTo(T(0)),
365364
)
365+
@requires MOI.supports(model, MOI.ConstraintName(), typeof(c))
366+
@requires MOI.supports(model, MOI.ConstraintName(), typeof(c2))
367+
@requires MOI.supports(model, MOI.ConstraintName(), typeof(cy))
366368
@test MOI.get(model, MOI.ConstraintName(), c) == ""
367369
@test MOI.get(model, MOI.ConstraintName(), c2) == ""
368370
@test MOI.get(model, MOI.ConstraintName(), cy) == ""
369-
@requires MOI.supports(model, MOI.ConstraintName(), typeof(c))
370371
MOI.set(model, MOI.ConstraintName(), c, "")
371-
@requires MOI.supports(model, MOI.ConstraintName(), typeof(c2))
372372
MOI.set(model, MOI.ConstraintName(), c2, "") # Shouldn't error with duplicate empty name
373-
@requires MOI.supports(model, MOI.ConstraintName(), typeof(cy))
374373
MOI.set(model, MOI.ConstraintName(), cy, "")
375374
MOI.set(model, MOI.ConstraintName(), c, "Con0")
376375
@test MOI.get(model, MOI.ConstraintName(), c) == "Con0"

0 commit comments

Comments
 (0)