|
93 | 93 | @test checkbounds(Bool, A, trues(1, 5), trues(1, 4, 1), trues(1, 1, 2)) == false
|
94 | 94 | @test checkbounds(Bool, A, trues(1, 5), trues(1, 5, 1), trues(1, 1, 3)) == false
|
95 | 95 | @test checkbounds(Bool, A, trues(1, 5), :, 2) == false
|
| 96 | + @test checkbounds(Bool, A, trues(5, 4), trues(3)) == true |
| 97 | + @test checkbounds(Bool, A, trues(4, 4), trues(3)) == true |
| 98 | + @test checkbounds(Bool, A, trues(5, 4), trues(2)) == false |
| 99 | + @test checkbounds(Bool, A, trues(6, 4), trues(3)) == false |
| 100 | + @test checkbounds(Bool, A, trues(5, 4), trues(4)) == false |
96 | 101 | end
|
97 | 102 |
|
98 | 103 | @testset "array of CartesianIndex" begin
|
@@ -453,6 +458,13 @@ function test_vector_indexing(::Type{T}, shape, ::Type{TestAbstractArray}) where
|
453 | 458 | @test B[mask1, mask2, trailing2] == A[mask1, mask2, trailing2] ==
|
454 | 459 | B[LinearIndices(mask1)[findall(mask1)], LinearIndices(mask2)[findall(mask2)], trailing2]
|
455 | 460 | @test B[mask1, 1, trailing2] == A[mask1, 1, trailing2] == LinearIndices(mask)[findall(mask1)]
|
| 461 | + |
| 462 | + if ndims(B) > 1 |
| 463 | + maskfront = bitrand(shape[1:end-1]) |
| 464 | + Bslice = B[ntuple(i->(:), ndims(B)-1)..., 1] |
| 465 | + @test B[maskfront,1] == Bslice[maskfront] |
| 466 | + @test size(B[maskfront, 1:1]) == (sum(maskfront), 1) |
| 467 | + end |
456 | 468 | end
|
457 | 469 | end
|
458 | 470 | end
|
|
838 | 850 | @test ndims((1:3)[:,:,1:1,:,:,[1]]) == 6
|
839 | 851 | end
|
840 | 852 |
|
| 853 | +@testset "issue #38192" begin |
| 854 | + img = cat([1 2; 3 4], [1 5; 6 7]; dims=3) |
| 855 | + mask = img[:,:,1] .== img[:,:,2] |
| 856 | + img[mask,2] .= 0 |
| 857 | + @test img == cat([1 2; 3 4], [0 5; 6 7]; dims=3) |
| 858 | +end |
| 859 | + |
841 | 860 | @testset "dispatch loop introduced in #19305" begin
|
842 | 861 | Z22, O33 = fill(0, 2, 2), fill(1, 3, 3)
|
843 | 862 | @test [(1:2) Z22; O33] == [[1,2] Z22; O33] == [[1 2]' Z22; O33]
|
|
0 commit comments