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 d514c33
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/logdensityproblems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
@test model.logdensity ===

@test_throws ArgumentError AbstractMCMC.LogDensityModel(mylogdensity)

try
LogDensityProblems.logdensity(model, ones(10))
catch exc
@test exc isa MethodError
@test occursin("is a wrapper", sprint(showerror, exc))
end
end

@testset "fallback for log densities" begin
Expand Down

0 comments on commit d514c33

Please sign in to comment.