Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
penelopeysm committed Nov 6, 2024
1 parent 979ea63 commit 0b854bd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/mcmc/hmc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,15 @@ using Turing
end
end

@testset "error for impossible model" begin
@model function demo_impossible()
x ~ Normal()
Turing.@addlogprob! -Inf
end

@test_throws ErrorException sample(demo_impossible(), NUTS(; adtype=adbackend), 5)
end

@testset "(partially) issue: #2095" begin
@model function vector_of_dirichlet(::Type{TV}=Vector{Float64}) where {TV}
xs = Vector{TV}(undef, 2)
Expand Down

0 comments on commit 0b854bd

Please sign in to comment.