Skip to content

Commit

Permalink
test: add test for extend with parameter dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianM-C committed Apr 12, 2024
1 parent c7e1c03 commit 9c9ecd9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/parameter_dependencies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ using NonlinearSolve
@test integ.ps[p2] == 10.0
end

@testset "extend" begin
@parameters p1=1.0 p2=1.0
@variables x(t)

@mtkbuild sys1 = ODESystem(
[D(x) ~ p1 * t + p2],
t
)
@named sys2 = ODESystem(
[],
t;
parameter_dependencies = [p2 => 2p1]
)
sys = extend(sys2, sys1)
@test isequal(only(parameters(sys)), p1)
@test Set(full_parameters(sys)) == Set([p1, p2])
end

@testset "Clock system" begin
dt = 0.1
@variables x(t) y(t) u(t) yd(t) ud(t) r(t) z(t)
Expand Down

0 comments on commit 9c9ecd9

Please sign in to comment.