Skip to content

Commit b6f52a4

Browse files
committed
add tests for io-handling on flattened systems
1 parent 0b84d17 commit b6f52a4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/input_output_handling.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,32 @@ D = Differential(tv)
3131
@test !is_bound(sys2, sys.u)
3232
@test !is_bound(sys2, sys2.sys.u)
3333

34+
fsys2 = flatten(sys2)
35+
@test is_bound(fsys2, sys.x)
36+
@test !is_bound(fsys2, sys.u)
37+
@test !is_bound(fsys2, sys2.sys.u)
38+
39+
3440
@test is_bound(sys3, sys.u) # I would like to write sys3.sys.u here but that's not how the variable is stored in the equations
3541
@test is_bound(sys3, sys.x)
3642

3743
@test is_bound(sys4, sys.u)
3844
@test !is_bound(sys4, u)
3945

46+
fsys4 = flatten(sys4)
47+
@test is_bound(fsys4, sys.u)
48+
@test !is_bound(fsys4, u)
49+
4050
@test isequal(inputs(sys), [u])
4151
@test isequal(inputs(sys2), [sys.u])
4252

4353
@test isempty(bound_inputs(sys))
4454
@test isequal(unbound_inputs(sys), [u])
4555

4656
@test isempty(bound_inputs(sys2))
57+
@test isempty(bound_inputs(fsys2))
4758
@test isequal(unbound_inputs(sys2), [sys.u])
59+
@test isequal(unbound_inputs(fsys2), [sys.u])
4860

4961
@test isequal(bound_inputs(sys3), [sys.u])
5062
@test isempty(unbound_inputs(sys3))

0 commit comments

Comments
 (0)