Skip to content

Commit 34c41d0

Browse files
authored
Get back to 100% code coverage (#2806)
1 parent 2c1b560 commit 34c41d0

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

src/FileFormats/MPS/MPS.jl

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,14 +1444,15 @@ end
14441444
function parse_rows_line(data::TempMPSModel{T}, items::Vector{String}) where {T}
14451445
if length(items) < 2
14461446
error("Malformed ROWS line: $(join(items, " "))")
1447-
elseif length(items) > 2
1448-
# We could throw an error here, but it seems like other solvers just
1449-
# happily ignore the extra fields.
1450-
#
1451-
# See https://github.com/jump-dev/MathOptInterface.jl/issues/2792
1452-
#
1453-
# Oscar dislikes the poorly standardized nature of MPS.
14541447
end
1448+
# if length(items) > 2
1449+
# We could throw an error here, but it seems like other solvers just
1450+
# happily ignore the extra fields.
1451+
#
1452+
# See https://github.com/jump-dev/MathOptInterface.jl/issues/2792
1453+
#
1454+
# Oscar dislikes the poorly standardized nature of MPS.
1455+
# end
14551456
sense, name = Sense(items[1]), items[2]
14561457
if haskey(data.name_to_row, name)
14571458
error("Duplicate row encountered: $(join(items, " ")).")

test/Bridges/Constraint/IntervalToHyperRectangleBridge.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,17 @@ function test_runtests(T)
116116
return
117117
end
118118

119+
function test_modify_ScalarCoefficientChange(T)
120+
inner = MOI.Utilities.Model{T}()
121+
model = MOI.Bridges.Constraint.IntervalToHyperRectangle{T}(inner)
122+
x = MOI.add_variable(model)
123+
c = MOI.add_constraint(model, T(1) * x, MOI.Interval(T(0), T(1)))
124+
@test (MOI.get(model, MOI.ConstraintFunction(), c), T(1) * x)
125+
MOI.modify(model, c, MOI.ScalarCoefficientChange(x, T(2)))
126+
@test (MOI.get(model, MOI.ConstraintFunction(), c), T(2) * x)
127+
return
128+
end
129+
119130
end # module
120131

121132
TestConstraintIntervalToHyperRectangle.runtests()

0 commit comments

Comments
 (0)