-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow SpecialFunctions v0.9 and v0.10
Also, simplify testing of error handling and avoid defining `libgslcblas` variable.
- Loading branch information
Showing
3 changed files
with
8 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
using Test | ||
import GSL | ||
|
||
@testset "Error Handling" begin | ||
@info "Testing error handler..." | ||
try | ||
GSL.vector_alloc(typemax(Csize_t)) | ||
catch e | ||
@test typeof(e) == OutOfMemoryError | ||
end | ||
# This is only needed to make `@test_logs` work with the custom error handling | ||
# of GSL.jl | ||
Base.occursin(r::Regex, err::GSL.C.GSLError) = occursin(r, repr(err)) | ||
|
||
@info "Testing error handler..." | ||
try | ||
sf_hyperg_2F1(1,2,3,4) | ||
catch e | ||
@test typeof(e) == DomainError | ||
end | ||
@testset "Error Handling" begin | ||
@test_logs (:warn, r"GSL Error 8") @test_throws OutOfMemoryError GSL.vector_alloc(typemax(Csize_t)) | ||
@test_logs (:warn, r"GSL Error 1") @test_throws DomainError sf_hyperg_2F1(1,2,3,4) | ||
end |