Skip to content

Commit 0f1d47f

Browse files
test: test eager initialization when tspan == (nothing, nothing)
1 parent 27189b3 commit 0f1d47f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/initialization.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,10 @@ end
263263
@testset "Trivial initialization" begin
264264
initprob = NonlinearProblem(Returns(nothing), nothing, [1.0])
265265
update_initializeprob! = function (iprob, integ)
266-
iprob.p[1] = integ.u[1]
266+
# just to access the current time and use it as a number, so this errors
267+
# if run on a problem with `current_time(prob) === nothing`
268+
iprob.p[1] = current_time(integ) + 1
269+
iprob.p[1] = state_values(integ)[1]
267270
end
268271
initprobmap = function (nlsol)
269272
u1 = parameter_values(nlsol)[1]
@@ -284,6 +287,11 @@ end
284287
@test u0 [2.0, 2.0]
285288
@test p 0.0
286289
@test success
290+
291+
@testset "Doesn't run in `remake` if `tspan == (nothing, nothing)`" begin
292+
prob = ODEProblem(fn, [2.0, 0.0], (nothing, nothing), 0.0)
293+
@test_nowarn remake(prob)
294+
end
287295
end
288296
end
289297

0 commit comments

Comments
 (0)