Skip to content

Commit

Permalink
fix #2215
Browse files Browse the repository at this point in the history
  • Loading branch information
baggepinnen committed Aug 24, 2023
1 parent 12c83d4 commit bed9504
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/systems/abstractsystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1424,7 +1424,12 @@ function markio!(state, orig_inputs, inputs, outputs; check = true)
outputset = Dict{Any, Bool}(o => false for o in outputs)
for (i, v) in enumerate(fullvars)
if v in keys(inputset)
v = setio(v, true, false)
if v in keys(outputset)
v = setio(v, true, true)
outputset[v] = true

Check warning on line 1429 in src/systems/abstractsystem.jl

View check run for this annotation

Codecov / codecov/patch

src/systems/abstractsystem.jl#L1427-L1429

Added lines #L1427 - L1429 were not covered by tests
else
v = setio(v, true, false)

Check warning on line 1431 in src/systems/abstractsystem.jl

View check run for this annotation

Codecov / codecov/patch

src/systems/abstractsystem.jl#L1431

Added line #L1431 was not covered by tests
end
inputset[v] = true
fullvars[i] = v
elseif v in keys(outputset)
Expand Down
7 changes: 7 additions & 0 deletions test/linearize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ lsys, ssys = linearize(sys, [r], [y])
@test lsys.C[] == 1
@test lsys.D[] == 0

lsys, ssys = linearize(sys, [r], [r])

@test lsys.A[] == -2
@test lsys.B[] == 1
@test lsys.C[] == 0
@test lsys.D[] == 1

##
```
Expand Down

0 comments on commit bed9504

Please sign in to comment.