Skip to content

Commit b079f51

Browse files
author
oscarddssmith
committed
relax check_error tests
1 parent 46e3153 commit b079f51

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/integrators/check_error.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ u0 = 0.0 # explosion time is 1.0
55
tspan = (0.0, 10.0)
66
prob = ODEProblem(f_ec, u0, tspan)
77
options = [:reltol => 1e-8, :abstol => 1e-8, :verbose => false]
8-
desired_code = ReturnCode.MaxIters
8+
desired_codes = (ReturnCode.MaxIters, ReturnCode.Unstable)
99

1010
# Test that sol.retcode is set to the correct value by various ways to
1111
# invoke integrator.
@@ -15,16 +15,16 @@ sol = solve(prob, Tsit5(); options...)
1515

1616
integrator = init(prob, Tsit5(); options...)
1717
solve!(integrator)
18-
@test integrator.sol.retcode == desired_code
18+
@test integrator.sol.retcode in desired_codes
1919

2020
integrator = init(prob, Tsit5(); options...)
2121
for _ in integrator
2222
end
23-
@test integrator.sol.retcode == desired_code
23+
@test integrator.sol.retcode in desired_codes
2424

2525
integrator = init(prob, Tsit5(); options...)
2626
step!(integrator, 10.0)
27-
@test integrator.sol.retcode == desired_code
27+
@test integrator.sol.retcode in desired_codes
2828

2929
# Test check_error
3030
integrator = init(prob, Tsit5(); options...)
@@ -33,7 +33,7 @@ step!(integrator)
3333
ok = false
3434
for i in 1:(integrator.opts.maxiters)
3535
step!(integrator)
36-
if check_error(integrator) == desired_code
36+
if check_error(integrator) in desired_codes
3737
global ok = true
3838
# @show i
3939
break

0 commit comments

Comments
 (0)