diff --git a/test/Li.jl b/test/Li.jl index 2abbac7..d232932 100644 --- a/test/Li.jl +++ b/test/Li.jl @@ -95,8 +95,10 @@ end @test PolyLog.li(n, BigFloat("1.0") + 0im) == PolyLog.zeta(n, BigFloat) #ForwardDiff Test - @test ForwardDiff.derivative(Base.Fix1(PolyLog.reli,n),float(pi)) == PolyLog.reli(n-1,float(pi))/float(pi) - @test ForwardDiff.derivative(Base.Fix1(PolyLog.reli,n),0.0) == 1.0 + if isdefined(Base,:get_extension) + @test ForwardDiff.derivative(Base.Fix1(PolyLog.reli,n),float(pi)) == PolyLog.reli(n-1,float(pi))/float(pi) + @test ForwardDiff.derivative(Base.Fix1(PolyLog.reli,n),0.0) == 1.0 + end end # value close to boundary between series 1 and 2 in arXiv:2010.09860 diff --git a/test/Li1.jl b/test/Li1.jl index 67c7f1d..7cf3b73 100644 --- a/test/Li1.jl +++ b/test/Li1.jl @@ -61,6 +61,8 @@ @test PolyLog.li1(1.0 + 1e300im) ≈ -690.77552789821371 + 1.5707963267948966im rtol=eps(Float64) #ForwardDiff Test - @test ForwardDiff.derivative(PolyLog.reli1,float(pi)) == 1/(1 - pi) - @test ForwardDiff.derivative(PolyLog.reli1,0.0) == 1.0 + if isdefined(Base,:get_extension) + @test ForwardDiff.derivative(PolyLog.reli1,float(pi)) == 1/(1 - pi) + @test ForwardDiff.derivative(PolyLog.reli1,0.0) == 1.0 + end end diff --git a/test/Li2.jl b/test/Li2.jl index cd0f031..c843e39 100644 --- a/test/Li2.jl +++ b/test/Li2.jl @@ -68,6 +68,8 @@ @test PolyLog.li2(1.0 + 1e300im) ≈ -238585.82620504462 + 1085.06766186232im rtol=eps(Float64) #ForwardDiff Test - @test ForwardDiff.derivative(PolyLog.reli2,float(pi)) == PolyLog.reli1(float(pi))/float(pi) - @test ForwardDiff.derivative(PolyLog.reli2,0.0) == 1.0 + if isdefined(Base,:get_extension) + @test ForwardDiff.derivative(PolyLog.reli2,float(pi)) == PolyLog.reli1(float(pi))/float(pi) + @test ForwardDiff.derivative(PolyLog.reli2,0.0) == 1.0 + end end diff --git a/test/Li3.jl b/test/Li3.jl index f3a1f6e..5a2b65e 100644 --- a/test/Li3.jl +++ b/test/Li3.jl @@ -62,6 +62,8 @@ @test PolyLog.li3(1.0 + 1e300im) ≈ -5.4936606061973454e7 + 374771.031356405im rtol=eps(Float64) #ForwardDiff Test - @test ForwardDiff.derivative(PolyLog.reli3,float(pi)) == PolyLog.reli2(float(pi))/float(pi) - @test ForwardDiff.derivative(PolyLog.reli3,0.0) == 1.0 + if isdefined(Base, :ForwardDiff) + @test ForwardDiff.derivative(PolyLog.reli3,float(pi)) == PolyLog.reli2(float(pi))/float(pi) + @test ForwardDiff.derivative(PolyLog.reli3,0.0) == 1.0 + end end diff --git a/test/Li4.jl b/test/Li4.jl index 8e3cf68..9afe139 100644 --- a/test/Li4.jl +++ b/test/Li4.jl @@ -54,6 +54,8 @@ @test PolyLog.li4(1.0 + 1e300im) ≈ -9.4872648206269765e9 + 8.62951114411071e7im rtol=eps(Float64) #ForwardDiff Test - @test ForwardDiff.derivative(PolyLog.reli4,float(pi)) == PolyLog.reli3(float(pi))/float(pi) - @test ForwardDiff.derivative(PolyLog.reli4,0.0) == 1.0 + if isdefined(Base,:get_extension) + @test ForwardDiff.derivative(PolyLog.reli4,float(pi)) == PolyLog.reli3(float(pi))/float(pi) + @test ForwardDiff.derivative(PolyLog.reli4,0.0) == 1.0 + end end diff --git a/test/runtests.jl b/test/runtests.jl index 52a3bac..0079842 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,6 +1,8 @@ using Test import PolyLog -import ForwardDiff +if isdefined(Base,:get_extension) + import ForwardDiff +end include("TestPrecision.jl") include("DataReader.jl")