Skip to content
This repository was archived by the owner on Jun 14, 2020. It is now read-only.

Commit 23e49bf

Browse files
committed
✅ Add tests
1 parent 3a7ef89 commit 23e49bf

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/runtests.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,3 +364,16 @@ end
364364
check_row(model, c, f4, s)
365365
end
366366
end
367+
368+
@testset "Issue #67" begin
369+
model = LQOI.MockLinQuadOptimizer()
370+
function objective_type_test(f::MOI.AbstractScalarFunction)
371+
MOI.set(model, MOI.ObjectiveFunction{typeof(f)}(), f)
372+
@test MOI.get(model, MOI.ObjectiveFunctionType()) == typeof(f)
373+
end
374+
x = MOI.add_variable(model)
375+
f = MOI.SingleVariable(x)
376+
objective_type_test(f)
377+
objective_type_test(convert(MOI.ScalarAffineFunction{Float64}, f))
378+
objective_type_test(convert(MOI.ScalarQuadraticFunction{Float64}, f))
379+
end

0 commit comments

Comments
 (0)