Skip to content

Commit efc835f

Browse files
committed
Test with duplicate names
1 parent b26d580 commit efc835f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/model_parsing.jl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,3 +854,25 @@ end
854854
@test getdefault(vec_false.n[i]) == 1
855855
end
856856
end
857+
858+
@testset "Duplicate names" begin
859+
mod = @__MODULE__
860+
@test_throws ErrorException ModelingToolkit._model_macro(mod, :ATest,
861+
:(begin
862+
@variables begin
863+
a(t)
864+
a(t)
865+
end
866+
end),
867+
false)
868+
@test_throws ErrorException ModelingToolkit._model_macro(mod, :ATest,
869+
:(begin
870+
@variables begin
871+
a(t)
872+
end
873+
@parameters begin
874+
a
875+
end
876+
end),
877+
false)
878+
end

0 commit comments

Comments
 (0)