|
1 | 1 | @testitem "PyArray" begin |
2 | 2 | x = pyimport("array").array("i", pylist([1, 2, 3])) |
3 | 3 | y = PyArray(x) |
4 | | - z = PyArray{Cint,1,false,false,Cint}(x) |
| 4 | + z = PyArray{Cint,1,()}(x) |
5 | 5 | @testset "construct" begin |
6 | | - @test y isa PyArray{Cint,1,true,true,Cint} |
7 | | - @test z isa PyArray{Cint,1,false,false,Cint} |
| 6 | + @test y isa PyArray{Cint,1,(:mutable,:linear,:contiguous)} |
| 7 | + @test z isa PyArray{Cint,1,()} |
8 | 8 | @test PythonCall.ispy(y) |
9 | 9 | @test PythonCall.ispy(z) |
10 | 10 | @test Py(y) === x |
|
29 | 29 | @testset "elsize" begin |
30 | 30 | @test Base.elsize(y) === sizeof(Cint) |
31 | 31 | @test Base.elsize(z) === sizeof(Cint) |
32 | | - @test Base.elsize(PyArray{Cint,1,true,true,Cint}) === sizeof(Cint) |
33 | | - @test Base.elsize(PyArray{Cint,1,false,false,Cint}) === sizeof(Cint) |
34 | | - @test_throws Exception elsize(PyArray{Cint,1,true,false,Cchar}) |
| 32 | + @test Base.elsize(PyArray{UInt8}) === sizeof(UInt8) |
| 33 | + @test Base.elsize(PyArray{UInt16,2}) === sizeof(UInt16) |
| 34 | + @test Base.elsize(PyArray{UInt32,3,(:mutable,)}) === sizeof(UInt32) |
| 35 | + @test_throws Exception elsize(PyArray{Py,1,()}) |
35 | 36 | end |
36 | 37 | @testset "getindex" begin |
37 | 38 | @test_throws BoundsError y[0] |
|
0 commit comments