Skip to content

Commit 6683cf5

Browse files
test: test nonnumerics aren't narrowed in ODEProblem and init
1 parent 44321ab commit 6683cf5

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/initializationsystem.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,3 +1682,23 @@ end
16821682
prob = ODEProblem(sys, [x[1] => nothing, x[2] => 1], (0.0, 1.0))
16831683
@test SciMLBase.initialization_status(prob) == SciMLBase.FULLY_DETERMINED
16841684
end
1685+
1686+
@testset "Nonnumerics aren't narrowed" begin
1687+
@mtkmodel Foo begin
1688+
@variables begin
1689+
x(t) = 1.0
1690+
end
1691+
@parameters begin
1692+
p::AbstractString
1693+
r = 1.0
1694+
end
1695+
@equations begin
1696+
D(x) ~ r * x
1697+
end
1698+
end
1699+
@mtkbuild sys = Foo(p = "a")
1700+
prob = ODEProblem(sys, [], (0.0, 1.0))
1701+
@test prob.p.nonnumeric[1] isa Vector{AbstractString}
1702+
integ = init(prob)
1703+
@test integ.p.nonnumeric[1] isa Vector{AbstractString}
1704+
end

0 commit comments

Comments
 (0)