Skip to content

Commit ed78c6f

Browse files
committed
Added test
1 parent d95f966 commit ed78c6f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/odesystem.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,3 +1194,13 @@ end
11941194
@test_nowarn obsfn(buffer, [1.0], ps..., 3.0)
11951195
@test buffer [2.0, 3.0, 4.0]
11961196
end
1197+
1198+
# https://github.com/SciML/ModelingToolkit.jl/issues/2818
1199+
@testset "Independent variable must be a parameter"
1200+
@parameters x
1201+
@variables y(x)
1202+
@test_nowarn @named sys = ODESystem([y ~ 0], x)
1203+
1204+
@variables x y(x)
1205+
@test_throws ArgumentError @named sys = ODESystem([y ~ 0], x)
1206+
end

0 commit comments

Comments
 (0)