Skip to content

Commit 2a0fcd3

Browse files
authored
[Test] Fix MOI.objective_expr(::InvalidEvaluator) (#2569)
1 parent f11a616 commit 2a0fcd3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Test/test_nonlinear.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ function MOI.features_available(::InvalidEvaluator)
11211121
return [:Grad, :ExprGraph]
11221122
end
11231123

1124-
MOI.objective_expr(::InvalidEvaluator) = :(NaN)
1124+
MOI.objective_expr(::InvalidEvaluator) = :(+($NaN))
11251125

11261126
MOI.eval_objective(::InvalidEvaluator, x) = NaN
11271127

@@ -1140,7 +1140,7 @@ written. External solvers can exclude this test without consequence.
11401140
"""
11411141
function test_nonlinear_InvalidEvaluator_internal(::MOI.ModelLike, ::Config)
11421142
d = InvalidEvaluator()
1143-
@test MOI.objective_expr(d) == :(NaN)
1143+
@test MOI.objective_expr(d) == :(+($NaN))
11441144
MOI.initialize(d, [:Grad, :ExprGraph])
11451145
x = [1.5]
11461146
# f(x)

0 commit comments

Comments
 (0)