Skip to content

Commit

Permalink
Add last remaining bessel tests
Browse files Browse the repository at this point in the history
Missed a few DomainErrors and Float32 fallbacks.
  • Loading branch information
kshyatt committed Jun 26, 2016
1 parent 3a51d11 commit 51abcf1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ true_i33 = 0.95975362949600785698
@test_approx_eq besseli(-3,3) true_i33
@test_approx_eq besseli(3,-3) -true_i33
@test_approx_eq besseli(-3,-3) -true_i33
@test_approx_eq besseli(Float32(-3),Complex64(-3,0)) -true_i33
@test_throws Base.Math.AmosException besseli(1,1000)
@test_throws DomainError besseli(0.4,-1.0)

Expand Down Expand Up @@ -454,6 +455,8 @@ y33 = bessely(3,3.)
@test_throws DomainError bessely(0.4,-1.0)
@test_throws DomainError bessely(0.4,Float32(-1.0))
@test_throws DomainError bessely(1,Float32(-1.0))
@test_throws DomainError bessely(Cint(3),Float32(-3.))
@test_throws DomainError bessely(Cint(3),Float64(-3.))

@test_throws MethodError bessely(1.2,big(1.0))
@test_throws MethodError bessely(1,complex(big(1.0)))
Expand All @@ -465,6 +468,7 @@ y33 = bessely(3,3.)
for elty in [Complex64,Complex128]
z = convert(elty, 1.0 + 1.9im)
@test_approx_eq besselhx(1.0, 1, z) convert(elty,-0.5949634147786144 - 0.18451272807835967im)
@test_approx_eq besselhx(Float32(1.0), 1, z) convert(elty,-0.5949634147786144 - 0.18451272807835967im)
end

@test_throws MethodError besselh(1,1,big(1.0))
Expand Down

0 comments on commit 51abcf1

Please sign in to comment.