Skip to content

Commit deb0b90

Browse files
committed
Add test for complex equations
1 parent adb6a84 commit deb0b90

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

test/complex.jl

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using ModelingToolkit
2+
using ModelingToolkit: t_nounits as t
3+
using Test
4+
5+
@mtkmodel ComplexModel begin
6+
@variables begin
7+
x(t)
8+
y(t)
9+
z(t)::Complex
10+
end
11+
@equations begin
12+
z ~ x + im*y
13+
end
14+
end
15+
@named mixed = ComplexModel()
16+
@test length(equations(mixed)) == 2

test/runtests.jl

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ end
7373
@safetestset "Initial Values Test" include("initial_values.jl")
7474
@safetestset "Discrete System" include("discrete_system.jl")
7575
@safetestset "Equation Type Accessors Test" include("equation_type_accessors.jl")
76+
@safetestset "Equations with complex values" include("complex.jl")
7677
end
7778
end
7879

0 commit comments

Comments
 (0)