Skip to content

Array Interface Test Suite #331

@Tokazama

Description

@Tokazama

I've come across comments that it takes many months or years before a new array type is dependable because it takes time to catch all the corner cases and bugs. I think we should be able to get an array to be safely usable for common applications in a much shorter time. It might help if we put together a set of tests for common assumptions that an array should meet so that testing is easier. For example...

function test_array_indices(x)
    lininds = eachindex(IndexLinear(), x)
    carinds = CartesianIndices(axes(x))
    for (li,ci) = zip(lininds,carinds)
        @test x[li] == x[ci]
    end
    @test length(lininds) == length(carinds) == length(x) == prod(size(x))
end

We could make that example a bit more verbose and inject some logging so that it's clear where errors come from.

We could also do similar things with stride-layout stuff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions