1
1
using ModelingToolkit, Test
2
2
using ModelingToolkit: get_gui_metadata,
3
- VariableDescription, getdefault, RegularConnector, get_ps
3
+ VariableDescription, getdefault, RegularConnector, get_ps, getname
4
4
using URIs: URI
5
5
using Distributions
6
6
using Unitful
@@ -146,7 +146,11 @@ l15 0" stroke="black" stroke-width="1" stroke-linejoin="bevel" fill="none"></pat
146
146
C_val = 20
147
147
R_val = 20
148
148
res__R = 100
149
- @named rc = RC (; C_val, R_val, resistor. R = res__R)
149
+ @mtkbuild rc = RC (; C_val, R_val, resistor. R = res__R)
150
+ resistor = getproperty (rc, :resistor ; namespace = false )
151
+ @test getname (rc. resistor) === getname (resistor)
152
+ @test getname (rc. resistor. R) === getname (resistor. R)
153
+ @test getname (rc. resistor. v) === getname (resistor. v)
150
154
# Test that `resistor.R` overrides `R_val` in the argument.
151
155
@test getdefault (rc. resistor. R) == res__R != R_val
152
156
# Test that `C_val` passed via argument is set as default of C.
@@ -166,7 +170,7 @@ l15 0" stroke="black" stroke-width="1" stroke-linejoin="bevel" fill="none"></pat
166
170
@test ModelingToolkit. get_gui_metadata (rc. resistor. p). layout == Pin. structure[:icon ] ==
167
171
URI (" file:///" * abspath (ENV [" MTK_ICONS_DIR" ], " pin.png" ))
168
172
169
- @test length (equations (structural_simplify (rc) )) == 1
173
+ @test length (equations (rc )) == 1
170
174
end
171
175
172
176
@testset " Parameters and Structural parameters in various modes" begin
0 commit comments