Skip to content

Commit 1f0aa92

Browse files
test: fix discrete event reinitialization test
1 parent b8c605c commit 1f0aa92

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/symbolic_events.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,8 +865,7 @@ end
865865
end
866866
@discrete_events begin
867867
[30] => [binary_valve_1.S ~ 0.0, binary_valve_2.Δp ~ 0.0]
868-
[60] => [
869-
binary_valve_1.S ~ 1.0, binary_valve_2.S ~ 0.0, binary_valve_2.Δp ~ 1.0]
868+
[60] => [binary_valve_1.S ~ 1.0, binary_valve_2.Δp ~ 1.0]
870869
[120] => [binary_valve_1.S ~ 0.0, binary_valve_2.Δp ~ 0.0]
871870
end
872871
end
@@ -877,6 +876,11 @@ end
877876
# Test Simulation
878877
prob = ODEProblem(sys, [], (0.0, 150.0))
879878
sol = solve(prob)
879+
# This is singular at the second event, but the derivatives are zero so it's
880+
# constant after that point anyway. Just make sure it hits the last event and
881+
# had the correct `u`.
882+
@test_broken SciMLBase.successful_retcode(sol)
883+
@test sol.t[end] >= 120.0
880884
@test sol[end] == [0.0, 0.0, 0.0]
881885
end
882886

0 commit comments

Comments
 (0)