Skip to content

Commit 6bba949

Browse files
committed
Add tests
1 parent 145a52b commit 6bba949

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/runtests.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ include("util.jl")
5353
end
5454
end
5555

56+
@testset "AbstractMCMC.getstats" begin
57+
t1, _ = AbstractMCMC.step(Random.default_rng(), model, StaticMH([Normal(0, 1), Normal(0, 1)]))
58+
t2, _ = AbstractMCMC.step(Random.default_rng(), model, MALA(x -> MvNormal(x, I)); initial_params=ones(2))
59+
for t in [t1, t2]
60+
stats = AbstractMCMC.getstats(t)
61+
@test stats == (accepted = t.accepted,)
62+
end
63+
end
64+
5665
@testset "StaticMH" begin
5766
# Set up our sampler with initial parameters.
5867
spl1 = StaticMH([Normal(0,1), Normal(0, 1)])

0 commit comments

Comments
 (0)