From 25f5c82656b20a117167fba7055740acb8e89e4a Mon Sep 17 00:00:00 2001 From: Steffen Ridderbusch Date: Sat, 15 Apr 2023 00:37:39 +0100 Subject: [PATCH] Add tests --- test/runtests.jl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index fe67cbdc..cc2dfb6e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -127,9 +127,14 @@ end end @testset "FitMvNormal" begin @test value(FitMvNormal(2)) == (zeros(2), Matrix(I, 2, 2)) - a, b = mergevals(FitMvNormal(2), OnlineStatsBase.eachrow([y y2]), OnlineStatsBase.eachrow([y2 y])) - @test a[1] ≈ b[1] - @test a[2] ≈ b[2] + a, b = mergestats(FitMvNormal(2), OnlineStatsBase.eachrow([y y2]), OnlineStatsBase.eachrow([y2 y])) + @test value(a)[1] ≈ value(b)[1] + @test value(a)[2] ≈ value(b)[2] + + @test all(mean(a) .≈ mean(ys)) + @test all(var(a) .≈ var(ys)) + @test cov(a)[1] ≈ cov(a)[4] ≈ var(ys) + @test cov(a)[2] ≈ cov(a)[3] end end #-----------------------------------------------------------------------# FastNode