Skip to content

Commit 3c370ad

Browse files
committed
Add another test
1 parent 268b106 commit 3c370ad

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test/ext/DynamicPPLMCMCChainsExt.jl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ using LinearAlgebra: I
1717
@testset "varinfos_to_chains" begin
1818
@model function f()
1919
x ~ Normal()
20-
y ~ Normal(x)
20+
y := x + 1
2121
return z ~ MvNormal(zeros(3), I)
2222
end
2323

@@ -35,6 +35,17 @@ using LinearAlgebra: I
3535
@test c.info.varname_to_symbol[@varname(z[3])] == Symbol("z[3]")
3636
end
3737

38+
@testset "vector, without include_colon_eq" begin
39+
vis = [VarInfo(model) for _ in 1:50]
40+
c = DynamicPPL.varinfos_to_chains(MCMCChains.Chains, model, vis, false)
41+
@test c isa MCMCChains.Chains
42+
@test size(c) == (50, 4, 1)
43+
@test c.info.varname_to_symbol[@varname(x)] == :x
44+
@test c.info.varname_to_symbol[@varname(z[1])] == Symbol("z[1]")
45+
@test c.info.varname_to_symbol[@varname(z[2])] == Symbol("z[2]")
46+
@test c.info.varname_to_symbol[@varname(z[3])] == Symbol("z[3]")
47+
end
48+
3849
@testset "matrix" begin
3950
vis = [VarInfo(model) for _ in 1:50, _ in 1:3]
4051
c = DynamicPPL.varinfos_to_chains(MCMCChains.Chains, model, vis)

0 commit comments

Comments
 (0)