Skip to content

Commit 93302f6

Browse files
committed
Check error better
1 parent 2c032a7 commit 93302f6

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

test/Utilities/test_matrix_of_constraints.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,9 +729,15 @@ function test_modify_scalar_coefficient_change_no_entry()
729729
c = MOI.add_constraint(model, func, set)
730730
MOI.Utilities.final_touch(model, nothing)
731731
MOI.modify(model, c, MOI.ScalarCoefficientChange(y, 0))
732+
change = MOI.ScalarCoefficientChange(y, 3)
732733
@test_throws(
733-
MOI.ModifyConstraintNotAllowed,
734-
MOI.modify(model, c, MOI.ScalarCoefficientChange(y, 3)),
734+
MOI.ModifyConstraintNotAllowed(
735+
c,
736+
change,
737+
"cannot set a new non-zero coefficient because no entry " *
738+
"exists in the sparse matrix of `MatrixOfConstraints`",
739+
),
740+
MOI.modify(model, c, change),
735741
)
736742
return
737743
end

0 commit comments

Comments
 (0)