-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use promote_type instead of promote_eltype in misc tests (#164)
- Loading branch information
1 parent
0079530
commit 1d392b8
Showing
2 changed files
with
12 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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)) | ||
# [email protected] 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 | ||
|