Skip to content

Commit

Permalink
Capture deprecation warnings in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
giordano committed Jan 19, 2022
1 parent c79947c commit e2460e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -482,12 +482,12 @@ end
end

@testset "Factorial and gamma" begin
@test @inferred(factorial(x)) measurement(6, 0.7536706010590813)
@test_logs (:warn, r"factorial.*is deprecated") @test @inferred(factorial(x)) measurement(6, 0.7536706010590813)
@test @inferred(digamma(y)) 1.256117668431802 ± 0.056764591147422994
@test @inferred(polygamma(3, w)) 193.40909103400242 ± 0.10422749480000776
for a in (w, x, y)
@test @inferred(gamma(a)) factorial(a - one(a))
@test @inferred(gamma(a + one(a))) factorial(a)
@test_logs (:warn, r"factorial.*is deprecated") @test @inferred(gamma(a)) factorial(a - one(a))
@test @inferred(gamma(a + one(a))) @test_logs (:warn, r"factorial.*is deprecated") factorial(a)
@test @inferred(logabsgamma(abs(a)))[1] log(gamma(abs(a)))
@test @inferred(digamma(a)) polygamma(0, a)
@test @inferred(digamma(invdigamma(a))) a + zero(a)
Expand Down

0 comments on commit e2460e3

Please sign in to comment.