Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Dec 12, 2024
1 parent 34d107b commit 2763108
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/Utilities/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@ end
function test_iteration_and_indexing_on_VectorOfVariables()
f = MOI.VectorOfVariables([z, w, x, y])
it = MOI.Utilities.eachscalar(f)
@test it isa AbstractVector{MOI.VariableIndex}
@test size(it) == (4,)
@test length(it) == 4
@test eltype(it) == MOI.VariableIndex
@test collect(it) == [z, w, x, y]
Expand All @@ -454,6 +456,8 @@ function test_indexing_on_VectorAffineFunction()
[2, 7, 5],
)
it = MOI.Utilities.eachscalar(f)
@test it isa AbstractVector{MOI.ScalarAffineFunction{Int}}
@test size(it) == (3,)
@test length(it) == 3
@test eltype(it) == MOI.ScalarAffineFunction{Int}
g = it[2]
Expand Down

0 comments on commit 2763108

Please sign in to comment.