Skip to content

Commit 98c36f3

Browse files
committed
bugfix in tests
1 parent e74e152 commit 98c36f3

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

test/runtests.jl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,22 @@ end
8686
# @test rand(κ(1.1)) == 1.1
8787
# end
8888

89-
# @testset "SpikeMixture" begin
90-
# @test rand(SpikeMixture(Dirac(0), 0.5)) == 0
91-
# @test rand(SpikeMixture(Dirac(1), 1.0)) == 1
92-
# w = 1/3
93-
# m = SpikeMixture(Normal(), w)
94-
# bm = basemeasure(m)
95-
# @test (bm.s*bm.w)*bm.m == 1.0*basemeasure(Normal())
96-
# @test density(m, 1.0)*(bm.s*bm.w) == w*density(Normal(),1.0)
97-
# @test density(m, 0)*(bm.s*(1-bm.w)) ≈ (1-w)
98-
# end
89+
@testset "SpikeMixture" begin
90+
@test rand(SpikeMixture(Dirac(0), 0.5)) == 0
91+
@test rand(SpikeMixture(Dirac(1), 1.0)) == 1
92+
w = 1/3
93+
m = SpikeMixture(d, w)
94+
bm = basemeasure(m)
95+
@test (bm.s*bm.w)*bm.m == 1.0*basemeasure(d)
96+
@test density(m, 1.0)*(bm.s*bm.w) w*density(d,1.0)
97+
@test density(m, 0)*(bm.s*(1-bm.w)) (1-w)
98+
end
9999

100-
# @testset "Dirac" begin
101-
# @test rand(Dirac(0.2)) == 0.2
102-
# @test logdensity(Dirac(0.3), 0.3) == 0.0
103-
# @test logdensity(Dirac(0.3), 0.4) == -Inf
104-
# end
100+
@testset "Dirac" begin
101+
@test rand(Dirac(0.2)) == 0.2
102+
@test logdensity(Dirac(0.3), 0.3) == 0.0
103+
@test logdensity(Dirac(0.3), 0.4) == -Inf
104+
end
105105

106106
# @testset "For" begin
107107
# FORDISTS = [

0 commit comments

Comments
 (0)