Skip to content

Commit

Permalink
Add tests for iterating over a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Nov 5, 2024
1 parent 139bead commit ee45858
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/test_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1338,4 +1338,14 @@ function test_set_abstract_string()
return
end

function test_iterate_scalar()
model = Model()
@variable(model, x)
@test collect(x) == [x]
@test !isempty(x)
@test iterate(x) == (x, true)
@test iterate(x, true) === nothing
return
end

end # module TestModels

0 comments on commit ee45858

Please sign in to comment.