Skip to content

Commit 6251241

Browse files
committed
test: add test
1 parent 3b77b31 commit 6251241

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/input_output_handling.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,3 +485,16 @@ end
485485
@test issetequal(ModelingToolkit.inputs(ss2), [z])
486486
@test issetequal(ModelingToolkit.outputs(ss2), [y])
487487
end
488+
489+
@testset "Retain inputs when composing systems" begin
490+
@variables x(t) y(t) [input=true]
491+
@named sys = System([D(x) ~ y * x], t)
492+
csys = compose(System(Equation[], t; name = :outer), sys)
493+
@test issetequal(ModelingToolkit.inputs(csys), [sys.y])
494+
495+
# More complex hierarchy
496+
@variables z(t) [input = true] w(t)
497+
@named sys2 = System([D(w) ~ z - w], t)
498+
cosys = compose(System(Equation[], t; name = :outermost), [csys, sys2])
499+
@test issetequal(ModelingToolkit.inputs(cosys), [csys.sys.y, sys2.z])
500+
end

0 commit comments

Comments
 (0)