Skip to content

Commit e7ccff5

Browse files
committed
Update
1 parent 3e78725 commit e7ccff5

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/Test/test_nonlinear.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,6 +2419,16 @@ function test_VectorNonlinearOracle_LagrangeMultipliers_MAX_SENSE(
24192419
@test isapprox(MOI.get(model, MOI.VariablePrimal(), x), [y, y], config)
24202420
@test isapprox(MOI.get(model, MOI.ConstraintDual(), c), T[-1, -1], config)
24212421
@test isapprox(MOI.get(model, MOI.LagrangeMultiplier(), c), T[-y])
2422+
# Test `set` just for code coverage
2423+
x = T[1, 2]
2424+
ret = T[0]
2425+
set.eval_f(ret, x)
2426+
@test ret == T[5]
2427+
ret = T[0, 0]
2428+
set.eval_jacobian(ret, x)
2429+
@test ret == T[2, 4]
2430+
set.eval_hessian_lagrangian(ret, x, T[-1])
2431+
@test ret == [-2, -2]
24222432
return
24232433
end
24242434

@@ -2488,6 +2498,16 @@ function test_VectorNonlinearOracle_LagrangeMultipliers_MIN_SENSE(
24882498
@test isapprox(MOI.get(model, MOI.VariablePrimal(), x), [-y, -y], config)
24892499
@test isapprox(MOI.get(model, MOI.ConstraintDual(), c), T[1, 1], config)
24902500
@test isapprox(MOI.get(model, MOI.LagrangeMultiplier(), c), T[y])
2501+
# Test `set` just for code coverage
2502+
x = T[1, 2]
2503+
ret = T[0]
2504+
set.eval_f(ret, x)
2505+
@test ret == T[-5]
2506+
ret = T[0, 0]
2507+
set.eval_jacobian(ret, x)
2508+
@test ret == T[-2, -4]
2509+
set.eval_hessian_lagrangian(ret, x, T[-1])
2510+
@test ret == [2, 2]
24912511
return
24922512
end
24932513

0 commit comments

Comments
 (0)