Skip to content

Commit 636168a

Browse files
committed
Add more tests for coverage
1 parent 566257e commit 636168a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/logdensityfunction.jl

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Test, DynamicPPL, ADTypes, LogDensityProblems, ReverseDiff
1+
using Test, DynamicPPL, ADTypes, LogDensityProblems, ForwardDiff
22

33
@testset "`getmodel` and `setmodel`" begin
44
@testset "$(nameof(model))" for model in DynamicPPL.TestUtils.DEMO_MODELS
@@ -22,4 +22,13 @@ end
2222
@test LogDensityProblems.dimension(logdensity) == length(θ)
2323
end
2424
end
25+
26+
@testset "capabilities" begin
27+
model = DynamicPPL.TestUtils.DEMO_MODELS[1]
28+
ldf = DynamicPPL.LogDensityFunction(model)
29+
@test LogDensityProblems.capabilities(typeof(ldf)) == LogDensityProblems.LogDensityOrder{0}()
30+
31+
ldf_with_ad = DynamicPPL.LogDensityFunction(model; adtype=AutoForwardDiff())
32+
@test LogDensityProblems.capabilities(typeof(ldf_with_ad)) == LogDensityProblems.LogDensityOrder{1}()
33+
end
2534
end

0 commit comments

Comments
 (0)