Skip to content

Commit

Permalink
added tests for getproperty
Browse files Browse the repository at this point in the history
  • Loading branch information
torfjelde committed May 9, 2024
1 parent be90ec0 commit 8640ff4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/debug_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,23 @@
@test !issuccess
@test_throws ErrorException check_model(buggy_model; error_on_failure=true)
end

@testset "subsumes (x.a then x)" begin
@model function buggy_subsumes_demo_model()
x = (a=nothing,)
x.a ~ Normal()
x ~ Normal()
return nothing
end
buggy_model = buggy_subsumes_demo_model()

@test_logs (:warn,) (:warn,) check_model(buggy_model)
issuccess = check_model(
buggy_model; context=SamplingContext(), record_varinfo=false
)
@test !issuccess
@test_throws ErrorException check_model(buggy_model; error_on_failure=true)
end
end

@testset "incorrect use of condition" begin
Expand Down

0 comments on commit 8640ff4

Please sign in to comment.