Skip to content

Commit 713a092

Browse files
test: test nonnumerics aren't narrowed in ODEProblem and init
1 parent 6e183b8 commit 713a092

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

0 commit comments

Comments
 (0)