Skip to content

Commit

Permalink
Add enum equation test.
Browse files Browse the repository at this point in the history
  • Loading branch information
perost authored and OpenModelica-Hudson committed Sep 10, 2018
1 parent ba6ffa5 commit 540aa9c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions flattening/modelica/equations/EnumEquation1.mo
@@ -0,0 +1,26 @@
// name: EnumEquation1
// keywords: equation, enumeration
// status: correct
//
// Checks that equations involving enumeration work.
//

model EnumEquation1
type E = enumeration(a, b, c);
E e1, e2;
equation
e1 = E.a;
E.b = e2;
E.a = E.a;
end EnumEquation1;

// Result:
// class EnumEquation1
// enumeration(a, b, c) e1;
// enumeration(a, b, c) e2;
// equation
// e1 = EnumEquation1.E.a;
// e2 = EnumEquation1.E.b;
// EnumEquation1.E.a = EnumEquation1.E.a;
// end EnumEquation1;
// endResult
1 change: 1 addition & 0 deletions flattening/modelica/equations/Makefile
Expand Up @@ -10,6 +10,7 @@ ConditionalArrayExpression2.mo \
ConnectInNonParamIf.mo \
ConnectInWhen.mo \
DAEexample.mo \
EnumEquation1.mo \
Epidemics1.mo \
EqualityEquations.mo \
EqualityEquationsCorrect.mo \
Expand Down

0 comments on commit 540aa9c

Please sign in to comment.