Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
YingboMa committed Jan 17, 2024
1 parent c7d6667 commit a0aad45
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/model_parsing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ end
# Ensure that modules consisting MTKModels with component arrays and icons of
# `Expr` type and `unit` metadata can be precompiled.
module PrecompilationTest
using Unitful, Test, ModelingToolkit
using Unitful, Test, ModelParsingPrecompile
@testset "Precompile packages with MTKModels" begin
push!(LOAD_PATH, joinpath(@__DIR__, "precompile_test"))

Expand Down Expand Up @@ -539,3 +539,16 @@ end
@test Equation[ternary_true.ternary_parameter_true ~ 0] == equations(ternary_true)
@test Equation[ternary_false.ternary_parameter_false ~ 0] == equations(ternary_false)
end

_b = Ref{Any}()
@mtkmodel MyModel begin
@variables begin
x___(t) = 0
end
begin
_b[] = x___
end
end
@named m = MyModel()
@variables t x___(t)
@test isequal(x___, _b[])

0 comments on commit a0aad45

Please sign in to comment.