Skip to content

Commit

Permalink
Update test_objective.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Jan 28, 2024
1 parent 40a88cc commit cf56be3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/test_objective.jl
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,16 @@ function test_set_objective_coefficient_quadratic()
@variable(model, x[1:2])
@objective(model, Min, x[1]^2 + x[1] * x[2] + x[1] + 2)
set_objective_coefficient(model, x[1], x[1], 2)
# TODO(odow): test modifying x[2], x[1] once MathOptInterface.jl#2408 is
# released.
set_objective_coefficient(model, x[1], x[2], 3)
@test isequal_canonical(
objective_function(model),
2 * x[1]^2 + 3 * x[1] * x[2] + x[1] + 2,
)
set_objective_coefficient(model, x[2], x[1], 4)
@test isequal_canonical(
objective_function(model),
2 * x[1]^2 + 4 * x[1] * x[2] + x[1] + 2,
)
return
end

Expand Down

0 comments on commit cf56be3

Please sign in to comment.