Skip to content

Commit ae12feb

Browse files
authored
test: relax @test_throws ErrorException to also allow BoundsError (#1431)
An issue with `Base` is that some methods of `size` throw `BoundsError` for an out-of-bounds second argument, while others throw `ErrorException` in the same case. Relax the tests here to allow for fixing that issue in `Base` in the future. PR that depends on this change: * JuliaLang/julia#59442
1 parent 76e280e commit ae12feb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/qr.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ rectangularQ(Q::LinearAlgebra.AbstractQ) = Matrix(Q)
174174
@test_throws DimensionMismatch rmul!(Matrix{eltya}(I, n+1, n+1),q)
175175
@test rmul!(squareQ(q), adjoint(q)) Matrix(I, n, n)
176176
@test_throws DimensionMismatch rmul!(Matrix{eltya}(I, n+1, n+1), adjoint(q))
177-
@test_throws ErrorException size(q,-1)
177+
@test_throws Union{BoundsError,ErrorException} size(q,-1)
178178
@test_throws DimensionMismatch LinearAlgebra.lmul!(q,zeros(eltya,n1+1))
179179
@test_throws DimensionMismatch LinearAlgebra.lmul!(adjoint(q), zeros(eltya,n1+1))
180180

@@ -196,7 +196,7 @@ rectangularQ(Q::LinearAlgebra.AbstractQ) = Matrix(Q)
196196
@test_throws DimensionMismatch rmul!(Matrix{eltya}(I, n+1, n+1),q)
197197
@test rmul!(squareQ(q), adjoint(q)) Matrix(I, n, n)
198198
@test_throws DimensionMismatch rmul!(Matrix{eltya}(I, n+1, n+1),adjoint(q))
199-
@test_throws ErrorException size(q,-1)
199+
@test_throws Union{BoundsError,ErrorException} size(q,-1)
200200
@test_throws DimensionMismatch q * Matrix{Int8}(I, n+4, n+4)
201201

202202
@test mul!(c, q, b) q*b

0 commit comments

Comments
 (0)