Skip to content

Commit 7d1772f

Browse files
committed
Add test
1 parent 60c0a94 commit 7d1772f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/Test/test_modification.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,3 +1061,18 @@ function test_modification_constraint_scalarquadraticcoefficientchange(
10611061
@test (MOI.get(model, MOI.ConstraintFunction(), c), g, config)
10621062
return
10631063
end
1064+
1065+
function test_modification_mathoptinterface_issue_2452(
1066+
model::MOI.ModelLike,
1067+
config::Config{T},
1068+
) where {T}
1069+
F, S = MOI.ScalarAffineFunction{T}, MOI.EqualTo{T}
1070+
@requires MOI.supports_constraint(model, F, S)
1071+
x, _ = MOI.add_constrained_variable(model, MOI.GreaterThan(T(1)))
1072+
c = MOI.add_constraint(model, T(2) * x, MOI.EqualTo(T(3)))
1073+
@test (MOI.get(dest, MOI.ConstraintFunction(), c), T(2) * x, config)
1074+
@test MOI.get(dest, MOI.ConstraintSet(), c) == MOI.EqualTo(T(3))
1075+
MOI.set(dest, MOI.ConstraintSet(), c, MOI.EqualTo(T(2)))
1076+
@test MOI.get(dest, MOI.ConstraintSet(), c) == MOI.EqualTo(T(2))
1077+
return
1078+
end

0 commit comments

Comments
 (0)