diff --git a/test/Containers/test_DenseAxisArray.jl b/test/Containers/test_DenseAxisArray.jl index 976784e5c2f..fd780720a35 100644 --- a/test/Containers/test_DenseAxisArray.jl +++ b/test/Containers/test_DenseAxisArray.jl @@ -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)) diff --git a/test/Containers/test_SparseAxisArray.jl b/test/Containers/test_SparseAxisArray.jl index ad5dd5ca4b5..94a30762b33 100644 --- a/test/Containers/test_SparseAxisArray.jl +++ b/test/Containers/test_SparseAxisArray.jl @@ -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)