Skip to content

Commit a7b22e4

Browse files
committed
test SVI as well
1 parent 3c370ad commit a7b22e4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/ext/DynamicPPLMCMCChainsExt.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@ using LinearAlgebra: I
4646
@test c.info.varname_to_symbol[@varname(z[3])] == Symbol("z[3]")
4747
end
4848

49+
@testset "Different VarInfo type" begin
50+
vis = [SimpleVarInfo(model) for _ in 1:50]
51+
c = DynamicPPL.varinfos_to_chains(MCMCChains.Chains, model, vis)
52+
@test c isa MCMCChains.Chains
53+
@test size(c) == (50, 5, 1)
54+
@test c.info.varname_to_symbol[@varname(x)] == :x
55+
@test c.info.varname_to_symbol[@varname(y)] == :y
56+
@test c.info.varname_to_symbol[@varname(z[1])] == Symbol("z[1]")
57+
@test c.info.varname_to_symbol[@varname(z[2])] == Symbol("z[2]")
58+
@test c.info.varname_to_symbol[@varname(z[3])] == Symbol("z[3]")
59+
end
60+
4961
@testset "matrix" begin
5062
vis = [VarInfo(model) for _ in 1:50, _ in 1:3]
5163
c = DynamicPPL.varinfos_to_chains(MCMCChains.Chains, model, vis)

0 commit comments

Comments
 (0)