Skip to content

Commit 4c08848

Browse files
committed
Add tests
1 parent 5acb295 commit 4c08848

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/test_gradedunitrangesext.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,21 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64})
350350
@test b[Block(1)] == a1
351351
@test iszero(b[Block(2)])
352352
@test all(GradedUnitRanges.space_isequal.(axes(b), (r,)))
353+
354+
# Regression test for BitArray
355+
r = gradedrange([U1(0) => 2, U1(1) => 3])
356+
a1 = trues(2, 2)
357+
a2 = trues(3, 3)
358+
a = cat(a1, a2; dims=(1, 2))
359+
b = a[r, dual(r)]
360+
@test eltype(b) === Bool
361+
@test b isa BlockSparseMatrix{Bool}
362+
@test blockstoredlength(b) == 2
363+
@test b[Block(1, 1)] == a1
364+
@test iszero(b[Block(2, 1)])
365+
@test iszero(b[Block(1, 2)])
366+
@test b[Block(2, 2)] == a2
367+
@test all(GradedUnitRanges.space_isequal.(axes(b), (r, dual(r))))
353368
end
354369
end
355370
end

0 commit comments

Comments
 (0)