Skip to content

Commit c0b7ded

Browse files
authored
Fix expression comparisons for Julia nightly (#4023)
1 parent 98dd735 commit c0b7ded

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/test_nlp.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ function test_expression_graphs()
761761
@test MOI.objective_expr(d) == :(x[$xidx]^2.0 + x[$yidx]^2.0)
762762
@test MOI.constraint_expr(d, 1) ==
763763
:((exp(x[$xidx]) - x[$yidx]) - 0.0 == 0.0)
764-
@test MOI.constraint_expr(d, 2) == :((exp(x[$xidx]) + 1) - 0.0 == 0.0)
764+
@test MOI.constraint_expr(d, 2) == :((exp(x[$xidx]) + 1.0) - 0.0 == 0.0)
765765
return
766766
end
767767

@@ -784,9 +784,9 @@ function test_more_expression_graphs()
784784
yidx = y.index
785785
@test MOI.objective_expr(d) == :(x[$xidx]^x[$yidx])
786786
@test MOI.constraint_expr(d, 1) ==
787-
:(sin(x[$xidx]) * cos(x[$yidx]) - 5 == 0.0)
788-
@test MOI.constraint_expr(d, 2) == :(1.0 * x[$xidx]^2 - 1.0 == 0.0)
789-
@test MOI.constraint_expr(d, 3) == :(2.0 * x[$xidx]^2 - 2.0 == 0.0)
787+
:(sin(x[$xidx]) * cos(x[$yidx]) - 5.0 == 0.0)
788+
@test MOI.constraint_expr(d, 2) == :(1.0 * x[$xidx]^2.0 - 1.0 == 0.0)
789+
@test MOI.constraint_expr(d, 3) == :(2.0 * x[$xidx]^2.0 - 2.0 == 0.0)
790790
@test MOI.constraint_expr(d, 4) == :(-0.5 <= sin(x[$xidx]) <= 0.5)
791791
@test MOI.constraint_expr(d, 5) ==
792792
:(ψ(x[$xidx]) + t(x[$xidx], x[$yidx]) - 3.0 <= 0.0)
@@ -801,7 +801,7 @@ function test_expression_graph_for_ifelse()
801801
MOI.initialize(d, [:ExprGraph])
802802
xidx = x.index
803803
@test MOI.objective_expr(d) ==
804-
:(ifelse(x[$xidx] <= 1, x[$xidx]^2, x[$xidx]))
804+
:(ifelse(x[$xidx] <= 1.0, x[$xidx]^2.0, x[$xidx]))
805805
return
806806
end
807807

0 commit comments

Comments
 (0)