Skip to content

Commit

Permalink
Update transducer.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion authored Jun 1, 2022
1 parent 8d7f22f commit df8cb0e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/transducer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
chain = sample(
MyModel(), MySampler(), N; discard_initial=discard_initial, progress=false
)
@test all(as[i] === chain[i].a for i in 1:N)
@test all(bs[i] === chain[i].b for i in 1:N)
@test all(as[i] == chain[i].a for i in 1:N)
@test all(bs[i] == chain[i].b for i in 1:N)
end

@testset "Thin chain by a factor of `thinning`" begin
Expand All @@ -92,7 +92,8 @@
# Repeat sampling with `sample`.
Random.seed!(1234)
chain = sample(MyModel(), MySampler(), N; thinning=thinning, progress=false)
@test all(as[i] === chain[i].a for i in 1:N)
@test all(bs[i] === chain[i].b for i in 1:N)
@test as[1] === chain[1].a === missing
@test all(as[i] == chain[i].a for i in 2:N)
@test all(bs[i] == chain[i].b for i in 1:N)
end
end

0 comments on commit df8cb0e

Please sign in to comment.