Skip to content

Commit

Permalink
solve! returns the problem (#658)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericphanson authored May 14, 2024
1 parent f8a56c4 commit 68e9efc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/solution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ end
Solves the problem, populating `problem.optval` with the optimal value, as well
as the values of the variables (accessed by [`evaluate`](@ref)) and constraint
duals (accessed by `cons.dual`), where applicable.
duals (accessed by `cons.dual`), where applicable. Returns the input `problem`.
Optional keyword arguments:
Expand Down Expand Up @@ -134,7 +134,7 @@ function solve!(
populate_dual!(context.model, c, indices)
end
end
return
return p
end

function populate_dual!(::MOI.ModelLike, c::Constraint, ::Nothing)
Expand Down
6 changes: 3 additions & 3 deletions test/test_utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function solve_and_return_output(problem, solver; kwargs...)
return fetch(out_task)
end

function test_solve!_does_not_return_anything()
function test_solve!_returns_the_problem()
x = Variable()
p = satisfy(x >= 0)
output = solve!(
Expand All @@ -53,7 +53,7 @@ function test_solve!_does_not_return_anything()
"eps_abs" => 1e-6,
),
)
@test output === nothing
@test output === p
return
end

Expand Down Expand Up @@ -85,7 +85,7 @@ function test_solve!_can_take_an_optimizer_directly()
"eps_abs" => 1e-6,
),
)
@test output === nothing
@test output === p
return
end

Expand Down

0 comments on commit 68e9efc

Please sign in to comment.