From fc12935d58e9f7bf51e11afcbc245940e5ca2879 Mon Sep 17 00:00:00 2001 From: Miles Lubin Date: Wed, 23 Nov 2016 13:46:17 -0500 Subject: [PATCH] add test for #877 --- test/model.jl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/model.jl b/test/model.jl index 2b62068463c..153a864954b 100644 --- a/test/model.jl +++ b/test/model.jl @@ -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