Skip to content

Commit 521f500

Browse files
test: test nonnumerics aren't narrowed in ODEProblem and init
1 parent 0032f99 commit 521f500

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
@@ -1670,3 +1670,23 @@ end
16701670
prob = ODEProblem(sys, [x[1] => nothing, x[2] => 1], (0.0, 1.0))
16711671
@test SciMLBase.initialization_status(prob) == SciMLBase.FULLY_DETERMINED
16721672
end
1673+
1674+
@testset "Nonnumerics aren't narrowed" begin
1675+
@mtkmodel Foo begin
1676+
@variables begin
1677+
x(t) = 1.0
1678+
end
1679+
@parameters begin
1680+
p::AbstractString
1681+
r = 1.0
1682+
end
1683+
@equations begin
1684+
D(x) ~ r * x
1685+
end
1686+
end
1687+
@mtkbuild sys = Foo(p = "a")
1688+
prob = ODEProblem(sys, [], (0.0, 1.0))
1689+
@test prob.p.nonnumeric[1] isa Vector{AbstractString}
1690+
integ = init(prob)
1691+
@test integ.p.nonnumeric[1] isa Vector{AbstractString}
1692+
end

0 commit comments

Comments
 (0)