diff --git a/test/parameter_indexing_test.jl b/test/parameter_indexing_test.jl index 77a7592b..452c8ebf 100644 --- a/test/parameter_indexing_test.jl +++ b/test/parameter_indexing_test.jl @@ -90,6 +90,8 @@ end function Base.getproperty(fs::FakeSolution, s::Symbol) s === :ps ? ParameterIndexingProxy(fs) : getfield(fs, s) end +SymbolicIndexingInterface.state_values(fs::FakeSolution) = fs.u +SymbolicIndexingInterface.current_time(fs::FakeSolution) = fs.t SymbolicIndexingInterface.symbolic_container(fs::FakeSolution) = fs.sys SymbolicIndexingInterface.parameter_values(fs::FakeSolution) = fs.p[end] SymbolicIndexingInterface.parameter_values(fs::FakeSolution, i) = fs.p[end][i] @@ -149,3 +151,20 @@ for (sym, val, arrval, check_inference) in [ @test get(fs, sub_inds) == arrval[sub_inds] end end + +ps = fs.p[2:2:end] +avals = getindex.(ps, 1) +bvals = getindex.(ps, 2) +cvals = getindex.(ps, 3) +for (sym, val, arrval) in [ + (:a, p[1], avals), + ((:b, :c), p[2:3], tuple.(bvals, cvals)), + ([:c, :a], p[[3, 1]], vcat.(cvals, avals)), + ] + get = getu(sys, sym) + @inferred get(fs) + @test get(fs) == arrval + for i in eachindex(ps) + @test get(fs, i) == arrval[i] + end +end