Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests on Julia nightly #863

Merged
merged 2 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
StatsAPI = "82ae8749-77ed-4fe6-ae5f-f523153014b0"

[compat]
Documenter = "0.24"
Documenter = "0.27"
13 changes: 10 additions & 3 deletions test/scalarstats.jl
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ x = sort!(vcat([5:-1:i for i in 1:5]...))
@test @inferred(isnan(sem(Int[], ProbabilityWeights(Int[]); mean=0f0)))

@test @inferred(isnan(sem(skipmissing(Union{Int,Missing}[missing, missing]))))
@test_throws MethodError sem(Any[])
@test_throws MethodError sem(skipmissing([missing]))
@test_throws Exception sem(Any[])
@test_throws Exception sem(skipmissing([missing]))

@test mad(1:5; center=3, normalize=true) ≈ 1.4826022185056018
@test mad(skipmissing([missing; 1:5; missing]); center=3, normalize=true) ≈ 1.4826022185056018
Expand All @@ -221,7 +221,14 @@ x = sort!(vcat([5:-1:i for i in 1:5]...))
@test_throws ArgumentError mad(Int[], normalize = true)
@test mad(Iterators.repeated(4, 10)) == 0
@test mad(Integer[1,2,3,4]) === mad(1:4)
@test (@benchmark mad((i for i in 1:10000))).allocs < 200
let itr = (i for i in 1:10000)
if VERSION >= v"1.10.0-"
# FIXME: Allocations are closer to 10x this on 1.10
@test_broken (@benchmark mad($itr)).allocs < 200
else
@test (@benchmark mad($itr)).allocs < 200
end
end

# Issue 197
@test mad(1:2, normalize=true) ≈ 0.7413011092528009
Expand Down