diff --git a/test/model_parsing.jl b/test/model_parsing.jl index 40fb0a13f2..704971878c 100644 --- a/test/model_parsing.jl +++ b/test/model_parsing.jl @@ -3,6 +3,7 @@ using ModelingToolkit: get_connector_type, get_defaults, get_gui_metadata, get_systems, get_ps, getdefault, getname, readable_code, scalarize, symtype, VariableDescription, RegularConnector, get_unit +using SymbolicIndexingInterface using URIs: URI using Distributions using DynamicQuantities, OrdinaryDiffEq @@ -876,3 +877,26 @@ end end), false) end + +@testset "Array parameters and subcomponent defaults" begin + @mtkmodel Foo begin + @parameters begin + p[1:3] + end + end + @mtkmodel Bar begin + @parameters begin + q[1:3] + end + @components begin + foo = Foo(p = q) + end + end + @named model = Bar() + model = complete(model) + # non-scalarized versions are parameters + @test is_parameter(model, model.q) + @test is_parameter(model, model.foo.p) + # default is correctly (not) namespaced + @test ModelingToolkit.defaults(model)[model.foo.p] == model.q +end