Skip to content

Commit d45b2d6

Browse files
author
Michael Abbott
committed
1 parent 214431c commit d45b2d6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/_basic.jl

+9
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,15 @@ end
205205
m = rand(3,4) .> 0.5 # BitArray{2}
206206
@test size(x[m]) == (sum(m),)
207207

208+
# indexing a view, https://github.com/JuliaArrays/AxisArrays.jl/issues/179
209+
v = view(x, :, 1:2)
210+
b = rand(6) .> 0.5 # BitArray{1}
211+
@test length(v[b]) == sum(b)
212+
@test length(view(v, b)) == sum(b)
213+
m = rand(3,2) .> 0.5 # BitArray{2}
214+
@test size(v[m]) == (sum(m),)
215+
@test size(view(v, m)) == (sum(m),)
216+
208217
end
209218
@testset "mutation" begin
210219

0 commit comments

Comments
 (0)