Skip to content

Commit 7938242

Browse files
committed
Update
1 parent b7be380 commit 7938242

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

src/Bridges/Constraint/bridges/ScalarSlackBridge.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function MOI.get(
5555
# that the original set was the same as the slacked set.
5656
return error(
5757
"Internal error: this method should never be called because it " *
58-
"represents and invalid state. Please open an issue to report.",
58+
"represents an invalid state. Please open an issue to report.",
5959
)
6060
end
6161

@@ -68,7 +68,7 @@ function MOI.get(
6868
# that the original set was the same as the slacked set.
6969
return error(
7070
"Internal error: this method should never be called because it " *
71-
"represents and invalid state. Please open an issue to report.",
71+
"represents an invalid state. Please open an issue to report.",
7272
)
7373
end
7474

test/Bridges/Constraint/ScalarSlackBridge.jl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,30 @@ function test_basis_status()
426426
return
427427
end
428428

429+
function test_internal_error()
430+
F, S = MOI.ScalarAffineFunction{Float64},MOI.EqualTo{Float64}
431+
BT = MOI.Bridges.Constraint.ScalarSlackBridge{Float64,F,S}
432+
model = MOI.Utilities.Model{Float64}()
433+
x = MOI.add_variable(model)
434+
set = MOI.EqualTo(1.0)
435+
bridge = MOI.Bridges.Constraint.bridge_constraint(BT, model, 1.0 * x, set)
436+
@test_throws(
437+
ErrorException(
438+
"Internal error: this method should never be called because it " *
439+
"represents an invalid state. Please open an issue to report.",
440+
),
441+
MOI.get(bridge, MOI.NumberOfConstraints{MOI.VariableIndex,S}()),
442+
)
443+
@test_throws(
444+
ErrorException(
445+
"Internal error: this method should never be called because it " *
446+
"represents an invalid state. Please open an issue to report.",
447+
),
448+
MOI.get(bridge, MOI.ListOfConstraintIndices{MOI.VariableIndex,S}()),
449+
)
450+
return
451+
end
452+
429453
end # module
430454

431455
TestConstraintSlack.runtests()

0 commit comments

Comments
 (0)