Closed
Description
On Julia master:
julia> Base.IteratorSize(pairs(IndexCartesian(), zeros(2,2)))
Base.HasShape{2}()
On Julia 0.6 with Compat:
julia> Compat.IteratorSize(Compat.pairs(IndexCartesian(), zeros(2,2)))
Base.HasLength()
We implicitly test for the latter behavior, making our tests fail on 0.7. We probably want to do
diff --git a/test/runtests.jl b/test/runtests.jl
index 4201f5fe..05bbf174 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -778,9 +778,9 @@ let
A14 = [11 13; 12 14]
R = CartesianIndices(Compat.axes(A14))
@test [a for (a,b) in pairs(IndexLinear(), A14)] == [1,2,3,4]
- @test [a for (a,b) in pairs(IndexCartesian(), A14)] == vec(collect(R))
+ @test [a for (a,b) in pairs(IndexCartesian(), A14)] == collect(R)
@test [b for (a,b) in pairs(IndexLinear(), A14)] == [11,12,13,14]
- @test [b for (a,b) in pairs(IndexCartesian(), A14)] == [11,12,13,14]
+ @test [b for (a,b) in pairs(IndexCartesian(), A14)] == [11 13; 12 14]
end
# Val(x)
But that requires fixing the result of pairs
, which currently relies on IndexValue
on 0.6. Should we replace the whole implementation
Lines 574 to 614 in 9ae1261
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
No labels