Skip to content

Commit

Permalink
add test for #877
Browse files Browse the repository at this point in the history
  • Loading branch information
mlubin committed Nov 23, 2016
1 parent 8d18bb5 commit fc12935
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/model.jl
Expand Up @@ -1014,3 +1014,15 @@ facts("[model] .^ broadcasting") do
@variable(m, x[1:2])
@fact (x.^2)[1] --> x[1]^2
end

facts("[model] Quadratic constraints with zero coefficients") do
for solver in quad_solvers
context("With solver $(typeof(solver))") do
m = Model(solver=solver)
@variable(m, 0 <= v <= 2)
@variable(m, 1 <= x <= 5)
@constraint(m, v >= 0.0 * x^2 + x)
@objective(m, Min, v)
@fact solve(m) --> :Optimal
@fact getvalue(v) --> roughly(1.0, TOL)
end; end; end

0 comments on commit fc12935

Please sign in to comment.