Skip to content

Commit

Permalink
tests to use FieldError exception for no field tests when available
Browse files Browse the repository at this point in the history
with PR#54504 field access exception is raised as `FieldError` exception now.
  • Loading branch information
arhik committed May 24, 2024
1 parent 9d4397f commit f85748b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/spqr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ itypes = sizeof(Int) == 4 ? (Int32,) : (Int32, Int64)
else
A = sparse(iltyA[1:n; rand(1:m, nn - n)], iltyA[1:n; rand(1:n, nn - n)], complex.(randn(nn), randn(nn)), m, n)
end

F = qr(A)
@test size(F) == (m,n)
@test size(F, 1) == m
Expand All @@ -39,7 +39,7 @@ itypes = sizeof(Int) == 4 ? (Int32,) : (Int32, Int64)
@test istriu(F.R)
@test isperm(F.pcol)
@test isperm(F.prow)
@test_throws ErrorException F.T
@test_throws isdefined(Base, :FieldError) ? FieldError : ErrorException F.T
end

@testset "apply Q" begin
Expand Down
2 changes: 1 addition & 1 deletion test/umfpack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ end
lua = lu(A)
umfpack_report(lua)
@test nnz(lua) == 18
@test_throws ErrorException lua.Z
@test_throws isdefined(Base, :FieldError) ? FieldError : ErrorException lua.Z
L,U,p,q,Rs = lua.:(:)
@test L == lua.L
@test U == lua.U
Expand Down

0 comments on commit f85748b

Please sign in to comment.