File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -352,7 +352,7 @@ function build_output(model_info)
352352 $ generator ($ (args... )) = $ (DynamicPPL. Model)($ evaluator, $ args_nt, $ model_gen_constructor)
353353 $ (generator_kw_form... )
354354
355- $ model_gen = $ model_gen_constructor
355+ $ (Base) . @__doc__ $ model_gen = $ model_gen_constructor
356356 end
357357end
358358
Original file line number Diff line number Diff line change 580580 model = demo ()
581581 @test all (iszero (model ()) for _ in 1 : 1000 )
582582 end
583+ @testset " docstring" begin
584+ " This is a test"
585+ @model function demo (x)
586+ m ~ Normal ()
587+ x ~ Normal (m, 1 )
588+ end
589+
590+ s = @doc (demo)
591+ @test string (s) == " This is a test\n "
592+
593+ # Verify that adding docstring didn't completely break execution of model
594+ m = demo (0. )
595+ @test m () isa Float64
596+ end
583597end
You can’t perform that action at this time.
0 commit comments