Skip to content

Commit e7cb53d

Browse files
test: make inline linear SCCs test more robust
1 parent 11a9087 commit e7cb53d

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

test/structural_transformation/tearing.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,11 @@ end
279279
@test length(equations(sys3)) == 1
280280
@test isequal(only(unknowns(sys3)), sys3.capacitor.v)
281281

282-
idx = findfirst(isequal(sys3.capacitor.n.i), observables(sys3))
283-
rhs = observed(sys3)[idx].rhs
284-
@test operation(rhs) === getindex
285-
@test operation(arguments(rhs)[1]) === (\)
282+
idx = findfirst(observed(sys3)) do eq
283+
arr, isarr = ModelingToolkit.MTKBase.split_indexed_var(eq.rhs)
284+
isarr && iscall(arr) && operation(arr) === (\)
285+
end
286+
@test idx !== nothing
286287

287288
prob1 = ODEProblem(sys1, [], (0.0, 10.0); guesses = [sys1.resistor1.v => 1.0])
288289
prob2 = ODEProblem(sys2, [], (0.0, 10.0))

0 commit comments

Comments
 (0)