Skip to content

Commit d514c33

Browse files
committed
Test that error message is correctly thrown
1 parent 6dfce50 commit d514c33

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/logdensityproblems.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222
@test model.logdensity ===
2323

2424
@test_throws ArgumentError AbstractMCMC.LogDensityModel(mylogdensity)
25+
26+
try
27+
LogDensityProblems.logdensity(model, ones(10))
28+
catch exc
29+
@test exc isa MethodError
30+
@test occursin("is a wrapper", sprint(showerror, exc))
31+
end
2532
end
2633

2734
@testset "fallback for log densities" begin

0 commit comments

Comments
 (0)