Skip to content

Commit d4de8fc

Browse files
committed
Update tests
1 parent b0358e6 commit d4de8fc

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

test/structural_transformation/index_reduction.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pendulum = ODESystem(eqs, t, [x, y, w, z, T], [L, g], name=:pendulum)
3434
pendulum = initialize_system_structure(pendulum)
3535
sss = structure(pendulum)
3636
@unpack graph, fullvars, varassoc = sss
37-
@test StructuralTransformations.matching(sss, varassoc .== 0) == map(x -> x == 0 ? StructuralTransformations.UNASSIGNED : x, [0, 1, 0, 0, 2, 0, 3, 0, 4])
37+
@test StructuralTransformations.matching(sss, varassoc .== 0) == map(x -> x == 0 ? StructuralTransformations.UNASSIGNED : x, [1, 2, 3, 4, 0, 0, 0, 0, 0])
3838

3939
sys, assign, eqassoc = StructuralTransformations.pantelides!(pendulum)
4040
sss = structure(sys)
@@ -48,8 +48,8 @@ scc = StructuralTransformations.find_scc(graph, assign)
4848
[6],
4949
]
5050

51-
@test graph.fadjlist == sort.([[1, 2], [4, 5], [3, 7, 8], [6, 7, 9], [3, 6], [2, 3, 5, 6], [1, 2, 8, 10], [4, 5, 9, 11], [2, 3, 5, 6, 10, 11]])
52-
@test varassoc == [8, 10, 2, 9, 11, 5, 0, 0, 0, 0, 0]
51+
@test graph.fadjlist == [[1, 7], [2, 8], [3, 5, 9], [4, 6, 9], [5, 6], [1, 2, 5, 6], [1, 3, 7, 10], [2, 4, 8, 11], [1, 2, 5, 6, 10, 11]]
52+
@test varassoc == [10, 11, 0, 0, 1, 2, 3, 4, 0, 0, 0]
5353
#1: D(x) ~ w
5454
#2: D(y) ~ z
5555
#3: D(w) ~ T*x

test/structural_transformation/tearing.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ eqs = [
145145
daesys = ODESystem(eqs, t)
146146
newdaesys = tearing(daesys)
147147
@test equations(newdaesys) == [D(x) ~ z; 0 ~ x + sin(z) - p*t]
148-
@test isequal(states(newdaesys), [z, x])
148+
@test isequal(states(newdaesys), [x, z])
149149
prob = ODAEProblem(newdaesys, [x=>1.0], (0, 1.0), [p=>0.2])
150150
du = [0.0]; u = [1.0]; pr = 0.2; tt = 0.1
151151
@test (@ballocated $(prob.f)($du, $u, $pr, $tt)) == 0

test/structural_transformation/utils.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ sys = initialize_system_structure(pendulum)
2020
StructuralTransformations.find_solvables!(sys)
2121
sss = structure(sys)
2222
@unpack graph, solvable_graph, fullvars, varassoc = sss
23-
@test isequal(fullvars, [w, D(x), x, z, D(y), y, T, D(w), D(z)])
24-
@test graph.fadjlist == sort.([[1, 2], [4, 5], [3, 7, 8], [6, 7, 9], [3, 6]])
23+
@test isequal(fullvars, [D(x), D(y), D(w), D(z), x, y, w, z, T])
24+
@test graph.fadjlist == [[1, 7], [2, 8], [3, 5, 9], [4, 6, 9], [5, 6]]
2525
@test graph.badjlist == 9 == length(fullvars)
2626
@test ne(graph) == nnz(incidence_matrix(graph)) == 12
2727
@test nv(solvable_graph) == 9 + 5
28-
@test varassoc == [8, 0, 2, 9, 0, 5, 0, 0, 0]
28+
@test varassoc == [0, 0, 0, 0, 1, 2, 3, 4, 0]
2929

3030
se = collect(StructuralTransformations.𝑠edges(graph))
3131
@test se == mapreduce(vcat, enumerate(graph.fadjlist)) do (s, d)

0 commit comments

Comments
 (0)