Skip to content

Commit

Permalink
[NF] Add tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
perost authored and OpenModelica-Hudson committed May 23, 2018
1 parent 74a7737 commit 62a0cb4
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
34 changes: 34 additions & 0 deletions flattening/modelica/scodeinst/ForEquation6.mo
@@ -0,0 +1,34 @@
// name: ForEquation6
// keywords:
// status: correct
// cflags: -d=newInst
//
//

model ForEquation6
Real x[3];
Real y[3];
equation
for i in 1:3 loop
x[i] = i;
y[i] = i;
end for;
end ForEquation6;

// Result:
// class ForEquation6
// Real x[1];
// Real x[2];
// Real x[3];
// Real y[1];
// Real y[2];
// Real y[3];
// equation
// x[1] = 1.0;
// y[1] = 1.0;
// x[2] = 2.0;
// y[2] = 2.0;
// x[3] = 3.0;
// y[3] = 3.0;
// end ForEquation6;
// endResult
2 changes: 2 additions & 0 deletions flattening/modelica/scodeinst/Makefile
Expand Up @@ -340,6 +340,7 @@ ForEquation2.mo \
ForEquation3.mo \
ForEquation4.mo \
ForEquation5.mo \
ForEquation6.mo \
ForEquationEnum1.mo \
ForEquationEnum2.mo \
ForEquationNonParam.mo \
Expand Down Expand Up @@ -690,6 +691,7 @@ Visibility4.mo \
When1.mo \
When2.mo \
When3.mo \
When4.mo \
WhenInitial1.mo \
WhenNested1.mo \
Wild1.mo \
Expand Down
27 changes: 27 additions & 0 deletions flattening/modelica/scodeinst/When4.mo
@@ -0,0 +1,27 @@
// name: When4
// keywords:
// status: correct
// cflags: -d=newInst
//
//

model When4
Real x, y;
equation
when time > 0 then
x = 1;
y = 2;
end when;
end When4;

// Result:
// class When4
// Real x;
// Real y;
// equation
// when time > 0.0 then
// x = 1.0;
// y = 2.0;
// end when;
// end When4;
// endResult

0 comments on commit 62a0cb4

Please sign in to comment.