Skip to content

Commit 656c13b

Browse files
committed
tests: Fix sparse DArray tests
1 parent 4969981 commit 656c13b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/array/allocation.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,11 @@ end
9797
Xsp = sprand(dist, T, dims..., 0.1)
9898
@test Xsp isa DArray{T,length(dims)}
9999
@test size(Xsp) == dims
100-
AXsp = collect(Xsp)
101100
AT = length(dims) == 2 ? SparseMatrixCSC : SparseVector
102-
@test AXsp isa AT{T}
101+
Ach = fetch(Xsp.chunks[1])
102+
@test Ach isa AT{T}
103+
AXsp = collect(Xsp)
104+
@test AXsp isa Array{T,length(dims)}
103105
@test AXsp == collect(Xsp)
104106
@test AXsp != collect(sprand(dist, T, dims..., 0.1))
105107
@test !allunique(AXsp)
@@ -212,7 +214,7 @@ end
212214
for dist in [Blocks(ntuple(i->10, length(dims))...),
213215
AutoBlocks()]
214216
if fn === sprand
215-
if length(dims) > 2
217+
if length(dims) > 2 || length(dims) == 0
216218
continue
217219
end
218220
@test fn(dist, dims..., 0.1) isa DArray{Float64,length(dims)}

0 commit comments

Comments
 (0)