Skip to content

Commit 98e46ea

Browse files
authored
Merge pull request #91 from TuringLang/csp/dist-test
Add some NoDist tests
2 parents af8ede0 + b2b33f9 commit 98e46ea

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

test/distribution_wrappers.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using DynamicPPL
2+
using Distributions
3+
using Bijectors
4+
5+
@testset "distribution_wrappers.jl" begin
6+
d = Normal()
7+
nd = DynamicPPL.NoDist(d)
8+
9+
# Smoke test
10+
rand(nd)
11+
12+
# Actual tests
13+
@test minimum(nd) == -Inf
14+
@test maximum(nd) == Inf
15+
@test logpdf(nd, 15.0) == 0
16+
@test Bijectors.logpdf_with_trans(nd, 0) == 0
17+
end

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ turnprogress(false)
1212
include("sampler.jl")
1313
include("prob_macro.jl")
1414
include("independence.jl")
15+
include("distribution_wrappers.jl")
1516
end

0 commit comments

Comments
 (0)