Skip to content

Commit f833fda

Browse files
committed
Update
1 parent e0f5277 commit f833fda

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/FileFormats/MOF/MOF.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ function HS071(x::Vector{MOI.VariableIndex})
9696
ExprEvaluator(
9797
:(x[$x1] * x[$x4] * (x[$x1] + x[$x2] + x[$x3]) + x[$x3]),
9898
[
99-
:(x[$x1] * x[$x2] * x[$x3] * x[$x4] >= 25),
100-
:(x[$x1]^2 + x[$x2]^2 + x[$x3]^2 + x[$x4]^2 == 40),
99+
:(x[$x1] * x[$x2] * x[$x3] * x[$x4] >= 25.0),
100+
:(x[$x1]^2.0 + x[$x2]^2.0 + x[$x3]^2.0 + x[$x4]^2.0 == 40.0),
101101
],
102102
),
103103
true,
@@ -117,7 +117,9 @@ function test_HS071()
117117
target = read(joinpath(@__DIR__, "nlp.mof.json"), String)
118118
target = replace(target, r"\s" => "")
119119
target = replace(target, "MathOptFormatModel" => "MathOptFormat Model")
120-
@test read(TEST_MOF_FILE, String) == target
120+
# Normalize .0 floats and integer representations in JSON
121+
normalize(x) = replace(x, ".0" => "")
122+
@test normalize(read(TEST_MOF_FILE, String)) == normalize(target)
121123
_validate(TEST_MOF_FILE)
122124
return
123125
end
@@ -308,7 +310,7 @@ function test_nonlinear_readingwriting()
308310
block = MOI.get(model2, MOI.NLPBlock())
309311
MOI.initialize(block.evaluator, [:ExprGraph])
310312
@test MOI.constraint_expr(block.evaluator, 1) ==
311-
:(2 * x[$x] + sin(x[$x])^2 - x[$y] == 1.0)
313+
:(2.0 * x[$x] + sin(x[$x])^2.0 - x[$y] == 1.0)
312314
_validate(TEST_MOF_FILE)
313315
return
314316
end

0 commit comments

Comments
 (0)