|
591 | 591 | @test findprev(b, T(1)) isa keytype(b)
|
592 | 592 | @test findprev(b, T(2)) isa keytype(b)
|
593 | 593 | end
|
| 594 | + |
| 595 | + @testset "issue #36938" begin |
| 596 | + # 👎 denotes tests that are broken. |
| 597 | + @test findfirst(fill(true, (0, 2))) === nothing # 👎 |
| 598 | + @test findfirst(fill(true, (2, 0))) === nothing |
| 599 | + @test findfirst(fill(true, (0, 0))) === nothing |
| 600 | + |
| 601 | + @test findlast(fill(true, (0, 2))) === nothing # 👎 |
| 602 | + @test findlast(fill(true, (2, 0))) === nothing |
| 603 | + @test findlast(fill(true, (0, 0))) === nothing |
| 604 | + |
| 605 | + @test findnext(fill(true, (2, 2)), CartesianIndex(1, 3)) === nothing |
| 606 | + @test findnext(fill(true, (2, 2)), CartesianIndex(3, 1)) === nothing # 👎 |
| 607 | + @test findnext(fill(true, (2, 2)), CartesianIndex(3, 3)) === nothing |
| 608 | + |
| 609 | + @test_throws BoundsError findnext(fill(true, (2, 2)), CartesianIndex(1, 0)) |
| 610 | + @test_throws BoundsError findnext(fill(true, (2, 2)), CartesianIndex(0, 1)) |
| 611 | + @test_throws BoundsError findnext(fill(true, (2, 2)), CartesianIndex(0, 0)) |
| 612 | + |
| 613 | + @test_throws BoundsError findprev(fill(true, (2, 2)), CartesianIndex(1, 3)) |
| 614 | + @test_throws BoundsError findprev(fill(true, (2, 2)), CartesianIndex(3, 1)) |
| 615 | + @test_throws BoundsError findprev(fill(true, (2, 2)), CartesianIndex(3, 3)) |
| 616 | + |
| 617 | + @test findprev(fill(true, (2, 2)), CartesianIndex(1, 0)) === nothing |
| 618 | + @test findprev(fill(true, (2, 2)), CartesianIndex(0, 1)) === nothing |
| 619 | + @test findprev(fill(true, (2, 2)), CartesianIndex(0, 0)) === nothing |
| 620 | + end |
594 | 621 | end
|
595 | 622 | @testset "find with Matrix" begin
|
596 | 623 | A = [1 2 0; 3 4 0]
|
|
0 commit comments