Skip to content

Commit

Permalink
Use promote_type instead of promote_eltype in misc tests (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack committed Feb 14, 2024
1 parent 0079530 commit 1d392b8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/misc.jl
Expand Up @@ -56,7 +56,7 @@ end
for eltyb in (Float32, Float64)
a = rand(eltya)
b = rand(eltyb)
T = Base.promote_eltype(eltya, eltyb)
T = Base.promote_type(eltya, eltyb)
@test typeof(logmvbeta(1, a, b)) == T
end
end
Expand Down
13 changes: 11 additions & 2 deletions test/rmath.jl
Expand Up @@ -5,8 +5,17 @@ using Test
include("utils.jl")

function check_rmath(fname, statsfun, rmathfun, params, aname, a, isprob, rtol)
v = @inferred(statsfun(params..., a))
rv = @inferred(rmathfun(params..., a))
# HypergeometricFunctions@0.3.18 made some changes that trips inference
# on older versions of Julia. Not worth the the time trying to debug/fix
# as we might drop support for these version soon so just putting the
# inference check behind a VERSION branch
if VERSION >= v"1.7"
v = @inferred(statsfun(params..., a))
rv = @inferred(rmathfun(params..., a))
else
v = statsfun(params..., a)
rv = rmathfun(params..., a)
end
@test v isa float(Base.promote_typeof(params..., a))
@test rv isa float(Base.promote_typeof(params..., a))
if isprob
Expand Down

0 comments on commit 1d392b8

Please sign in to comment.