Skip to content

Commit e80aa34

Browse files
committed
add README test
1 parent 2c3685f commit e80aa34

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/runtests.jl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ using Test
33
using MeasureTheory
44
import TransformVariables as TV
55
using TransformVariables: transform
6+
using SampleChainsDynamicHMC
67
using Aqua
8+
79
Aqua.test_all(Soss; ambiguities=false, unbound_args=false)
810

911
include("examples-list.jl")
@@ -19,6 +21,30 @@ include("examples-list.jl")
1921
end
2022
end
2123

24+
@testset "README" begin
25+
26+
m = @model x begin
27+
α ~ Lebesgue(ℝ)
28+
β ~ Normal()
29+
σ ~ Exponential()
30+
y ~ For(x) do xj
31+
Normal+ β * xj, σ)
32+
end
33+
return y
34+
end
35+
36+
x = randn(20)
37+
38+
predα = predictive(m, )
39+
40+
y = rand(predα(x=x,α=10.0))
41+
42+
post = sample(m(x=x) | (y=y,), dynamichmc())
43+
44+
@test post isa AbstractArray
45+
46+
end
47+
2248
@testset "Examples" begin
2349
for example in EXAMPLES
2450
@testset "Run example: $(example[1])" begin

0 commit comments

Comments
 (0)