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
7 changes: 6 additions & 1 deletion src/attributes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,12 @@ function submit(model::ModelLike, sub::AbstractSubmittable, args...)
),
)
else
throw(UnsupportedSubmittable(sub))
throw(
UnsupportedSubmittable(
sub,
"submit(::$(typeof(model)), ::$(typeof(sub))) is not supported.",
),
)
end
end

Expand Down
12 changes: 12 additions & 0 deletions test/attributes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,18 @@ function test_ConstraintBasisStatus_fallback()
)
end

function test_UnsupportedSubmittable()
model = DummyModelWithAdd()
sub = MOI.LazyConstraint{Int}(1)
@test_throws(
MOI.UnsupportedSubmittable(
sub,
"submit(::$(typeof(model)), ::$(typeof(sub))) is not supported.",
),
MOI.submit(model, sub, 1),
)
end

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