Skip to content

Commit b49e9c8

Browse files
authored
Add test for Bool indexing with an indexing vector that batches (#157)
* Add test for Bool indexing with an indexing vector that batches * Move test into the getindex with vector testset
1 parent 24bbb8e commit b49e9c8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/runtests.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,10 @@ end
496496
@test size(r) == (2,2,3)
497497
@test r == a[i...]
498498
@test getindex_count(a1) == 1
499+
# This Bool vector is supposed to need batching
500+
i = Bool[1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1]
501+
u = UnchunkedDiskArray(rand(275,305,36))
502+
@test u[i,1,1][1] == u[findfirst(i),1,1]
499503
end
500504

501505
@testset "Vector getindex strategies" begin
@@ -845,6 +849,8 @@ end
845849
@test getindex_count(A) == 0
846850
end
847851

852+
853+
848854
# @test offsets == [[1:1,2:3,4:4],[5:5,6:6,7:7],[8:8,9:9]]
849855
# inds = [1,1,1,3,5,6,6,7,10,13,16,16,19,20]
850856
# readranges, offsets = find_subranges_sorted(inds,false)

0 commit comments

Comments
 (0)