Skip to content

Commit d7f908e

Browse files
test: test add_fallbacks! bug
1 parent 3993abd commit d7f908e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/initial_values.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,11 @@ end
174174
@test_throws ModelingToolkit.UnexpectedSymbolicValueInVarmap ODEProblem(
175175
sys, [x => 1, y => 2], (0.0, 1.0), [p => 2q, q => 3p])
176176
end
177+
178+
@testset "`add_fallbacks!` checks scalarized array parameters correctly" begin
179+
@variables x(t)[1:2]
180+
@parameters p[1:2, 1:2]
181+
@mtkbuild sys = ODESystem(D(x) ~ p * x, t)
182+
# used to throw a `MethodError` complaining about `getindex(::Nothing, ::CartesianIndex{2})`
183+
@test_throws ModelingToolkit.MissingParametersError ODEProblem(sys, [x => ones(2)], (0.0, 1.0))
184+
end

0 commit comments

Comments
 (0)