@@ -103,7 +103,7 @@ prob = ODEProblem(sys, [u0; p], tspan)
103
103
sol = solve (prob, Rodas4 ())
104
104
105
105
@test_throws ArgumentError sol[x]
106
- @test in (sol[lorenz1. x], [getindex .(sol. u, 1 ) for i in 1 : length (unknowns (sol. prob. f. sys))])
106
+ @test in (sol[lorenz1. x], [getindex .(sol. u, i ) for i in 1 : length (unknowns (sol. prob. f. sys))])
107
107
@test_throws KeyError sol[:x ]
108
108
109
109
# ## Non-symbolic indexing tests
@@ -331,13 +331,14 @@ end
331
331
@test _idxs == [1 ]
332
332
@test _ss isa SciMLBase. SavedSubsystem
333
333
_idxs, _ss = SciMLBase. get_save_idxs_and_saved_subsystem (prob, x)
334
- @test _idxs == 1
334
+ xidx = variable_index (prob, x)
335
+ @test _idxs == xdx
335
336
@test _ss isa SciMLBase. SavedSubsystem
336
337
_idxs, _ss = SciMLBase. get_save_idxs_and_saved_subsystem (prob, [x])
337
- @test _idxs == [1 ]
338
+ @test _idxs == [xidx ]
338
339
@test _ss isa SciMLBase. SavedSubsystem
339
340
_idxs, _ss = SciMLBase. get_save_idxs_and_saved_subsystem (prob, [x, q])
340
- @test _idxs == [1 ]
341
+ @test _idxs == [xidx ]
341
342
@test _ss isa SciMLBase. SavedSubsystem
342
343
_idxs, _ss = SciMLBase. get_save_idxs_and_saved_subsystem (prob, [q])
343
344
@test _idxs == Int[]
0 commit comments