Skip to content

Commit 2763108

Browse files
committed
Add tests
1 parent 34d107b commit 2763108

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/Utilities/functions.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,8 @@ end
434434
function test_iteration_and_indexing_on_VectorOfVariables()
435435
f = MOI.VectorOfVariables([z, w, x, y])
436436
it = MOI.Utilities.eachscalar(f)
437+
@test it isa AbstractVector{MOI.VariableIndex}
438+
@test size(it) == (4,)
437439
@test length(it) == 4
438440
@test eltype(it) == MOI.VariableIndex
439441
@test collect(it) == [z, w, x, y]
@@ -454,6 +456,8 @@ function test_indexing_on_VectorAffineFunction()
454456
[2, 7, 5],
455457
)
456458
it = MOI.Utilities.eachscalar(f)
459+
@test it isa AbstractVector{MOI.ScalarAffineFunction{Int}}
460+
@test size(it) == (3,)
457461
@test length(it) == 3
458462
@test eltype(it) == MOI.ScalarAffineFunction{Int}
459463
g = it[2]

0 commit comments

Comments
 (0)