Skip to content

Commit fcc6a7a

Browse files
committed
Fix tests
1 parent 80371f4 commit fcc6a7a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/odesystem.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,17 +608,18 @@ let
608608
@test sol[y] 0.9 * sol[x[1]] + sol[x[2]]
609609
@test isapprox(sol[x[1]][end], 1, atol = 1e-3)
610610

611-
prob = DAEProblem(sys, [D(y) => 0, D(x[1]) => 0, D(x[2]) => 0], Pair[x[1] => 0.5],
611+
prob = DAEProblem(sys, [D(y) => 0, D(x[1]) => 0, D(x[2]) => 0], [x[1] => 0.5],
612612
(0, 50))
613-
@test prob.u0 [0.5, 0]
613+
u0_dict = Dict(x[1] => 0.5, x[2] => 0.0)
614+
@test prob.u0 [u0_dict[x] for x in states(sys)]
614615
@test prob.du0 [0, 0]
615616
@test prob.p [1]
616617
sol = solve(prob, IDA())
617618
@test isapprox(sol[x[1]][end], 1, atol = 1e-3)
618619

619620
prob = DAEProblem(sys, [D(y) => 0, D(x[1]) => 0, D(x[2]) => 0], Pair[x[1] => 0.5],
620621
(0, 50), [k => 2])
621-
@test prob.u0 [0.5, 0]
622+
@test prob.u0 [u0_dict[x] for x in states(sys)]
622623
@test prob.du0 [0, 0]
623624
@test prob.p [2]
624625
sol = solve(prob, IDA())

0 commit comments

Comments
 (0)