From d45b2d6d2f637418d5beeb2d81f616023d94604f Mon Sep 17 00:00:00 2001 From: Michael Abbott Date: Mon, 16 Mar 2020 21:49:28 +0100 Subject: [PATCH] BitArray & view, https://github.com/JuliaArrays/AxisArrays.jl/issues/179 --- test/_basic.jl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/_basic.jl b/test/_basic.jl index 1862959..522935c 100644 --- a/test/_basic.jl +++ b/test/_basic.jl @@ -205,6 +205,15 @@ end m = rand(3,4) .> 0.5 # BitArray{2} @test size(x[m]) == (sum(m),) + # indexing a view, https://github.com/JuliaArrays/AxisArrays.jl/issues/179 + v = view(x, :, 1:2) + b = rand(6) .> 0.5 # BitArray{1} + @test length(v[b]) == sum(b) + @test length(view(v, b)) == sum(b) + m = rand(3,2) .> 0.5 # BitArray{2} + @test size(v[m]) == (sum(m),) + @test size(view(v, m)) == (sum(m),) + end @testset "mutation" begin