From d448390975f16e0ada587fd3b1f245f04b26821d Mon Sep 17 00:00:00 2001 From: Eric Hanson <5846501+ericphanson@users.noreply.github.com> Date: Tue, 14 May 2024 17:41:17 +0200 Subject: [PATCH] solve! returns the problem --- src/solution.jl | 4 ++-- test/test_utilities.jl | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/solution.jl b/src/solution.jl index 282600505..997a2b76c 100644 --- a/src/solution.jl +++ b/src/solution.jl @@ -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: @@ -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) diff --git a/test/test_utilities.jl b/test/test_utilities.jl index 5944eb14f..c096afec6 100644 --- a/test/test_utilities.jl +++ b/test/test_utilities.jl @@ -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!( @@ -53,7 +53,7 @@ function test_solve!_does_not_return_anything() "eps_abs" => 1e-6, ), ) - @test output === nothing + @test output === p return end @@ -85,7 +85,7 @@ function test_solve!_can_take_an_optimizer_directly() "eps_abs" => 1e-6, ), ) - @test output === nothing + @test output === p return end