Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Mar 25, 2024
1 parent ddd80c1 commit d1e34b2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/qcqp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,20 @@ function test_name(x, y, T)
@test_broken MOI.get(inner, attr, ci) == "con_ref"
end

function test_start(x, y, T)
inner = MOI.Utilities.UniversalFallback(Model{T}())
model = PolyJuMP.QCQP.Optimizer{T}(inner)
a = MOI.add_variable(model)
MOI.set(model, MOI.VariablePrimalStart(), a, 2one(T))
b = MOI.add_variable(model)
MOI.set(model, MOI.VariablePrimalStart(), b, 3one(T))
p = PolyJuMP.ScalarPolynomialFunction(one(T) * x^3 - x * y^2, [a, b])
MOI.add_constraint(model, p, MOI.LessThan(zero(T)))
MOI.Utilities.final_touch(model, nothing)
vis = MOI.get(inner, MOI.ListOfVariableIndices())
@test sort(MOI.get(inner, MOI.VariablePrimalStart(), vis)) == T[2, 3, 4, 9]
end

function runtests(x, y)
for name in names(@__MODULE__; all = true)
if startswith("$name", "test_")
Expand Down

0 comments on commit d1e34b2

Please sign in to comment.