Skip to content

Commit 0e15d2c

Browse files
committed
Add BlockedArray tests
1 parent b33a155 commit 0e15d2c

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

test/test_blockarrays.jl

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ end
127127
# non-Int block lengths
128128
blocklen = big(10)^30
129129
blks = [Fill(1.0, blocklen), Fill(2.0, blocklen)]
130-
ret = BlockArray{eltype(eltype(blks)),ndims(blks),typeof(blks)}(undef_blocks, [blocklen, blocklen])
130+
ret = BlockArray{Float64,1,typeof(blks)}(undef_blocks, [blocklen,blocklen])
131131
ret[Block(1)] = blks[1]
132132
ret[Block(2)] = blks[2]
133133
@test size(ret) == (2blocklen,)
@@ -169,6 +169,20 @@ end
169169
@test BlockedMatrix(M) == M
170170
@test BlockedArray(M) == M
171171
end
172+
173+
# non-Int block lengths
174+
blocklen = big(10)^30
175+
blks = [Fill(1.0, blocklen), Fill(2.0, blocklen)]
176+
ret = BlockedArray{Float64,1,eltype(blks)}(undef_blocks, [blocklen,blocklen])
177+
ret[Block(1)] = blks[1]
178+
ret[Block(2)] = blks[2]
179+
@test size(ret) == (2blocklen,)
180+
@test blocksize(ret) == (2,)
181+
@test blocklengths.(axes(ret)) == ([blocklen,blocklen],)
182+
@test ret[Block(1)] == Fill(1.0, blocklen)
183+
@test ret[Block(2)] == Fill(2.0, blocklen)
184+
@test ret[1] == 1.0
185+
@test ret[blocklen + 1] == 2.0
172186
end
173187

174188
@testset "similar" begin

0 commit comments

Comments
 (0)