Skip to content

Commit 039ad77

Browse files
committed
Fix tests
1 parent 8b91af7 commit 039ad77

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Bridges/Bridges.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,10 @@ function runtests(
283283
Test.@test all(isnothing, MOI.get(model, attr, x))
284284
primal_start = fill(constraint_start, length(x))
285285
MOI.set(model, attr, x, primal_start)
286-
Test.@test MOI.get(model, attr, x) primal_start
286+
if !isempty(x)
287+
# ≈ does not work if x is empty because the return of get is Any[]
288+
Test.@test MOI.get(model, attr, x) primal_start
289+
end
287290
end
288291
# Test ConstraintPrimalStart and ConstraintDualStart
289292
for (F, S) in MOI.get(model, MOI.ListOfConstraintTypesPresent())
@@ -295,7 +298,11 @@ function runtests(
295298
Test.@test MOI.get(model, attr, ci) === nothing
296299
start = _fake_start(constraint_start, set)
297300
MOI.set(model, attr, ci, start)
298-
Test.@test MOI.get(model, attr, ci) start
301+
if !isempty(ci)
302+
# ≈ does not work if ci is empty because the return of
303+
# get is Any[]
304+
Test.@test MOI.get(model, attr, ci) start
305+
end
299306
end
300307
end
301308
end

0 commit comments

Comments
 (0)