Skip to content

Commit

Permalink
Test that error message is correctly thrown
Browse files Browse the repository at this point in the history
  • Loading branch information
penelopeysm committed Sep 12, 2024
1 parent 6dfce50 commit bf9d733
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/logdensityproblems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
@test model.logdensity ===

@test_throws ArgumentError AbstractMCMC.LogDensityModel(mylogdensity)

@test_throws MethodError LogDensityProblems.logdensity(model, ones(10))
if isdefined(Base.Experimental, :register_error_hint)
@test_throws "is a wrapper" LogDensityProblems.logdensity(model, ones(10))
end
end

@testset "fallback for log densities" begin
Expand Down

0 comments on commit bf9d733

Please sign in to comment.