Skip to content

Commit 1d1e279

Browse files
committed
Write test for SciML#3638
1 parent a4ba071 commit 1d1e279

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/model_parsing.jl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,3 +1058,24 @@ end
10581058
@test isequal(constrs[2], -4 + ex.y 0)
10591059
@test ModelingToolkit.get_consolidate(ex)([1, 2]) 1 + log(2)
10601060
end
1061+
1062+
module NoUsingMTK # From #3638
1063+
using ModelingToolkit: @mtkmodel, @variables, @parameters, t_nounits as t
1064+
1065+
@mtkmodel MyModel begin
1066+
@variables begin
1067+
x(t)
1068+
y(t)
1069+
end
1070+
@parameters begin
1071+
a
1072+
end
1073+
@equations begin
1074+
y ~ a * x
1075+
end
1076+
end
1077+
end
1078+
1079+
@testset "Model can be defined even without `using MTK` (#3638)" begin
1080+
@test NoUsingMTK.MyModel(; name=:foo) isa ModelingToolkit.AbstractSystem # just test that it ran fine
1081+
end

0 commit comments

Comments
 (0)