Skip to content

Commit 44afc27

Browse files
authored
Refactor tests for model optimization in predictors
Updated tests for model optimization results with reduced cost checks.
1 parent 4edcbcf commit 44afc27

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

test/test_predictors.jl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -825,11 +825,8 @@ function test_LeakyReLU_Epigraph()
825825
fix.(x, [-1, 2])
826826
optimize!(model)
827827
@test is_solved_and_feasible(model; dual = true)
828-
@test value.(y) [-0.123, 2.0]
829-
@test dual.(all_constraints(model, AffExpr, MOI.GreaterThan{Float64})) [
830-
0.0, # since x1 is negative
831-
1 - f.negative_slope,
832-
]
828+
@test (value.(y), [-0.123, 2.0]; atol = 1e-3)
829+
@test (reduced_cost.(x), [0.123, 1.0]; atol = 1e-3)
833830
return
834831
end
835832

0 commit comments

Comments
 (0)