Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Test] fix isapprox in test_modification_xxx_scalarquadraticcoefficientchange #2322

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Test/test_modification.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1027,14 +1027,14 @@
x = MOI.add_variable(model)
MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
MOI.set(model, attr, T(1) * x * x + T(2) * x + T(3))
@test MOI.get(model, attr)T(1) * x * x + T(2) * x + T(3)
@test ≈(MOI.get(model, attr), T(1) * x * x + T(2) * x + T(3), config)

Check warning on line 1030 in src/Test/test_modification.jl

View check run for this annotation

Codecov / codecov/patch

src/Test/test_modification.jl#L1030

Added line #L1030 was not covered by tests
MOI.modify(model, attr, MOI.ScalarQuadraticCoefficientChange(x, x, T(4)))
@test MOI.get(model, attr)T(2) * x * x + T(2) * x + T(3)
@test ≈(MOI.get(model, attr), T(2) * x * x + T(2) * x + T(3), config)

Check warning on line 1032 in src/Test/test_modification.jl

View check run for this annotation

Codecov / codecov/patch

src/Test/test_modification.jl#L1032

Added line #L1032 was not covered by tests
y = MOI.add_variable(model)
MOI.set(model, attr, T(1) * x * x + T(2) * x * y)
@test MOI.get(model, attr)T(1) * x * x + T(2) * x * y
@test ≈(MOI.get(model, attr), T(1) * x * x + T(2) * x * y, config)

Check warning on line 1035 in src/Test/test_modification.jl

View check run for this annotation

Codecov / codecov/patch

src/Test/test_modification.jl#L1035

Added line #L1035 was not covered by tests
MOI.modify(model, attr, MOI.ScalarQuadraticCoefficientChange(x, y, T(4)))
@test MOI.get(model, attr)T(1) * x * x + T(4) * x * y
@test ≈(MOI.get(model, attr), T(1) * x * x + T(4) * x * y, config)

Check warning on line 1037 in src/Test/test_modification.jl

View check run for this annotation

Codecov / codecov/patch

src/Test/test_modification.jl#L1037

Added line #L1037 was not covered by tests
return
end

Expand All @@ -1050,10 +1050,10 @@
y = MOI.add_variable(model)
f = T(1) * x * x + T(1) * x * x - T(1) * x * y + T(2) * y * y - T(1) * x * y
c = MOI.add_constraint(model, f, MOI.LessThan(T(1)))
@test MOI.get(model, MOI.ConstraintFunction(), c) ≈ f
@test ≈(MOI.get(model, MOI.ConstraintFunction(), c), f, config)

Check warning on line 1053 in src/Test/test_modification.jl

View check run for this annotation

Codecov / codecov/patch

src/Test/test_modification.jl#L1053

Added line #L1053 was not covered by tests
g = T(1) * x * x + T(-3) * x * y + T(2) * y * y
MOI.modify(model, c, MOI.ScalarQuadraticCoefficientChange(x, x, T(2)))
MOI.modify(model, c, MOI.ScalarQuadraticCoefficientChange(x, y, -T(3)))
@test MOI.get(model, MOI.ConstraintFunction(), c) ≈ g
@test ≈(MOI.get(model, MOI.ConstraintFunction(), c), g, config)

Check warning on line 1057 in src/Test/test_modification.jl

View check run for this annotation

Codecov / codecov/patch

src/Test/test_modification.jl#L1057

Added line #L1057 was not covered by tests
return
end
Loading