Skip to content

Commit 3d66c7a

Browse files
committed
update tests
1 parent 127126d commit 3d66c7a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

test/probprog/simulate.jl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,24 @@ end
8787
σ = Reactant.ConcreteRNumber(1.0)
8888

8989
trace, weight = ProbProg.simulate(model2, seed, μ, σ, shape)
90-
91-
println(trace)
9290

9391
@test size(trace.retval) == shape
92+
93+
@test length(trace.choices) == 2
9494
@test haskey(trace.choices, :s)
9595
@test haskey(trace.choices, :t)
96+
97+
@test length(trace.subtraces) == 2
98+
@test haskey(trace.subtraces[:s].choices, :a)
99+
@test haskey(trace.subtraces[:s].choices, :b)
100+
@test haskey(trace.subtraces[:t].choices, :a)
101+
@test haskey(trace.subtraces[:t].choices, :b)
102+
96103
@test size(trace.choices[:s]) == shape
97104
@test size(trace.choices[:t]) == shape
105+
98106
@test trace.weight isa Float64
107+
108+
@test trace.weight trace.subtraces[:s].weight + trace.subtraces[:t].weight
99109
end
100110
end

0 commit comments

Comments
 (0)