Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Nov 1, 2024
1 parent 636191e commit f7a26ba
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/test_variable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1680,4 +1680,24 @@ function test_add_constrained_variable()
return
end

function test_add_variable_in_set()
model = Model()
@variable(model, x1 >= 0, set = MOI.Integer())
@test has_lower_bound(x1)
@test is_integer(x1)
@variable(model, x2 <= 0, set = MOI.Integer())
@test has_upper_bound(x2)
@test is_integer(x2)
@variable(model, x3 == 0, set = MOI.Integer())
@test is_fixed(x3)
@test is_integer(x3)
@variable(model, x4 in MOI.EqualTo(3.0), Int)
@test is_fixed(x4)
@test is_integer(x4)
@variable(model, x5 in MOI.EqualTo(3.0), Bin)
@test is_fixed(x5)
@test is_binary(x5)
return
end

end # module TestVariable

0 comments on commit f7a26ba

Please sign in to comment.