Skip to content

Commit

Permalink
fix new test on 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
aplavin committed May 16, 2024
1 parent 588ac75 commit 931452f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/weights.jl
Original file line number Diff line number Diff line change
Expand Up @@ -610,13 +610,13 @@ end
end
end

@testset "custom weight types" begin
struct MyWeights <: AbstractWeights{Float64, Float64, Vector{Float64}}
values::Vector{Float64}
sum::Float64
end
MyWeights(values) = MyWeights(values, sum(values))
struct MyWeights <: AbstractWeights{Float64, Float64, Vector{Float64}}
values::Vector{Float64}
sum::Float64
end
MyWeights(values) = MyWeights(values, sum(values))

@testset "custom weight types" begin
@test mean([1, 2, 3], MyWeights([1, 4, 10])) 2.6
@test mean([1, 2, 3], MyWeights([NaN, 4, 10])) |> isnan
@test mode([1, 2, 3], MyWeights([1, 4, 10])) == 3
Expand Down

0 comments on commit 931452f

Please sign in to comment.