Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Nov 27, 2023
1 parent 74b65f7 commit adbcca5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
7 changes: 3 additions & 4 deletions test/Containers/test_DenseAxisArray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -863,10 +863,9 @@ function test_sum_dims()
end

function test_multi_arg_eachindex()
model = Model()
@variable(model, x[2:3])
@variable(model, y[2:3])
@variable(model, z[2:4, 1:2])
Containers.@container(x[i = 2:3], i)
Containers.@container(y[i = 2:3], i)
Containers.@container(z[i = 2:4, j = 1:2], i + j)
@test eachindex(x) == CartesianIndices((2,))
@test eachindex(y) == CartesianIndices((2,))
@test eachindex(z) == CartesianIndices((3, 2))
Expand Down
11 changes: 7 additions & 4 deletions test/Containers/test_SparseAxisArray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,13 @@ function test_containers_sparseaxisarray_kwarg_setindex()
end

function test_multi_arg_eachindex()
model = Model()
@variable(model, x[2:3], container = SparseAxisArray)
@variable(model, y[2:3], container = SparseAxisArray)
@variable(model, z[2:4, 1:2], container = SparseAxisArray)
Containers.@container(x[i = 2:3], i, container = SparseAxisArray)
Containers.@container(y[i = 2:3], i, container = SparseAxisArray)
Containers.@container(
z[i = 2:4, j = 1:2],
i + j,
container = SparseAxisArray,
)
@test eachindex(x) == keys(x.data)
@test eachindex(y) == keys(y.data)
@test eachindex(z) == keys(z.data)
Expand Down

0 comments on commit adbcca5

Please sign in to comment.