From 26cc8e9f1e526ece9504c8034b69334bde3fdaaa Mon Sep 17 00:00:00 2001 From: Carleton Coffrin Date: Sun, 13 Aug 2023 16:05:17 -0600 Subject: [PATCH] add test for jump direct model, closes #275 --- test/model.jl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/model.jl b/test/model.jl index 52b5eb33..608eb52d 100644 --- a/test/model.jl +++ b/test/model.jl @@ -21,6 +21,15 @@ @test pm.model[:my_var] == x @test m[:my_var] == x end + + @testset "run with user provided JuMP model in direct mode" begin + m = JuMP.direct_model(HiGHS.Optimizer()) + JuMP.set_optimizer_attribute(m, "output_flag", false) + result = run_dc_opf("../test/data/matpower/case5.m", milp_solver, jump_model=m) + + @test result["termination_status"] == OPTIMAL + @test isapprox(result["objective"], 17613; atol = 1e0) + end end