From a0aad457e7e2301b4d16a44d40f6435ce3cecaec Mon Sep 17 00:00:00 2001 From: Yingbo Ma Date: Wed, 17 Jan 2024 14:17:00 -0500 Subject: [PATCH] Add tests --- test/model_parsing.jl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/test/model_parsing.jl b/test/model_parsing.jl index f94d7483fd..240ea2485f 100644 --- a/test/model_parsing.jl +++ b/test/model_parsing.jl @@ -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")) @@ -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[])