Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/FlatZinc/model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ function MOI.get(model::Model, ::MOI.ObjectiveFunction{MOI.VariableIndex})
return model.objective_function
end

MOI.supports(::Model, ::MOI.ObjectiveFunction{MOI.VariableIndex}) = true

function MOI.set(
model::Model,
::MOI.ObjectiveFunction{MOI.VariableIndex},
Expand Down
6 changes: 5 additions & 1 deletion test/FlatZinc/model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
@testset "Supported constraints" begin
m = CP.FlatZinc.Model()

@test MOI.supports(
m,
MOI.ObjectiveFunction{MOI.VariableIndex}(),
)
@test MOI.supports_constraint(
m,
MOI.VariableIndex,
Expand Down Expand Up @@ -105,4 +109,4 @@
@test MOI.supports_add_constrained_variable(m, S)
@test MOI.supports_add_constrained_variables(m, S)
end
end
end
Loading