From 9da0398b30017f43c59a28bf0c4e5638ca07aa2e Mon Sep 17 00:00:00 2001 From: richardreeve Date: Thu, 30 Nov 2023 00:13:32 +0000 Subject: [PATCH] Add in testing of different input types --- test/test_dists.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test_dists.jl b/test/test_dists.jl index 4a3f4c1..7a0d324 100644 --- a/test/test_dists.jl +++ b/test/test_dists.jl @@ -427,6 +427,8 @@ end # testset @test (@inferred corr_dist(x, y)) ≈ cosine_dist(x .- mean(x), vec(y) .- mean(y)) @test (@inferred chisq_dist(x, y)) == sum((x - vec(y)).^2 ./ (x + vec(y))) @test (@inferred spannorm_dist(x, y)) == maximum(x - vec(y)) - minimum(x - vec(y)) + @test (@inferred kl_divergence(x, y)) ≈ sum(x[i] * log(x[i] / y[i]) for i in eachindex(x, y)) + @test (@inferred gkl_divergence(x, y)) ≈ sum(x[i] * log(x[i] / y[i]) - x[i] + y[i] for i in eachindex(x, y)) @test (@inferred meanad(x, y)) ≈ mean(Float64[abs(x[i] - y[i]) for i in eachindex(x, y)]) @test (@inferred msd(x, y)) ≈ mean(Float64[abs2(x[i] - y[i]) for i in eachindex(x, y)]) @test (@inferred rmsd(x, y)) ≈ sqrt(msd(x, y))