Skip to content

Commit cea83b3

Browse files
committed
Migrate model parsing test to DynamicQuantities and better tests
1 parent c0cf44a commit cea83b3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/model_parsing.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using ModelingToolkit: get_gui_metadata,
44
VariableDescription, RegularConnector
55
using URIs: URI
66
using Distributions
7-
using Unitful
7+
using DynamicQuantities, OrdinaryDiffEq
88

99
ENV["MTK_ICONS_DIR"] = "$(@__DIR__)/icons"
1010

@@ -143,6 +143,10 @@ C_val = 20
143143
R_val = 20
144144
res__R = 100
145145
@mtkbuild rc = RC(; C_val, R_val, resistor.R = res__R)
146+
prob = ODEProblem(rc, [], (0, 1e9))
147+
sol = solve(prob, Rodas5P())
148+
defs = ModelingToolkit.defaults(rc)
149+
@test sol[rc.capacitor.v, end] defs[rc.constant.k]
146150
resistor = getproperty(rc, :resistor; namespace = false)
147151
@test getname(rc.resistor) === getname(resistor)
148152
@test getname(rc.resistor.R) === getname(resistor.R)

0 commit comments

Comments
 (0)