Skip to content

Commit 2038a05

Browse files
authored
Update penalty_relaxation.jl
1 parent 81b4f6b commit 2038a05

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

test/Utilities/penalty_relaxation.jl

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,7 @@ function test_relax_bounds()
6666
end
6767

6868
function test_relax_no_warn()
69-
src_str = """
70-
variables: x, y
71-
minobjective: x + y
72-
x >= 0.0
73-
y <= 0.0
74-
x in ZeroOne()
75-
y in Integer()
76-
"""
77-
relaxed_str = """
69+
input = """
7870
variables: x, y
7971
minobjective: x + y
8072
x >= 0.0
@@ -83,12 +75,11 @@ function test_relax_no_warn()
8375
y in Integer()
8476
"""
8577
model = MOI.Utilities.Model{Float64}()
86-
MOI.Utilities.loadfromstring!(model, src_str)
87-
@test_logs(
88-
MOI.modify(model, MOI.Utilities.PenaltyRelaxation(; warn = false)),
89-
)
78+
MOI.Utilities.loadfromstring!(model, input)
79+
relaxation = MOI.Utilities.PenaltyRelaxation(; warn = false)
80+
@test_logs MOI.modify(model, relaxation)
9081
dest = MOI.Utilities.Model{Float64}()
91-
MOI.Utilities.loadfromstring!(dest, relaxed_str)
82+
MOI.Utilities.loadfromstring!(dest, input)
9283
MOI.Bridges._test_structural_identical(model, dest)
9384
return
9485
end

0 commit comments

Comments
 (0)