Skip to content

Commit

Permalink
Added tuple test cases for nfinst.
Browse files Browse the repository at this point in the history
  • Loading branch information
perost authored and OpenModelica-Hudson committed Oct 2, 2017
1 parent 297f7c6 commit 74ef35d
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 0 deletions.
3 changes: 3 additions & 0 deletions flattening/modelica/scodeinst/Makefile
Expand Up @@ -290,6 +290,9 @@ SubscriptWrongType1.mo \
SubscriptWrongType2.mo \
Terminate1.mo \
TerminateInvalid1.mo \
TupleInvalid1.mo \
TupleInvalid2.mo \
TupleInvalid3.mo \
type2.mo \
TypeDim1.mo \
TypeDim2.mo \
Expand Down
19 changes: 19 additions & 0 deletions flattening/modelica/scodeinst/TupleInvalid1.mo
@@ -0,0 +1,19 @@
// name: TupleInvalid1
// keywords:
// status: incorrect
// cflags: -d=newInst
//

model TupleInvalid1
Real x = (1, 2);
end TupleInvalid1;

// Result:
// Error processing file: TupleInvalid1.mo
// [flattening/modelica/scodeinst/TupleInvalid1.mo:8:3-8:18:writable] Error: Tuple expressions may only occur on the left side of an assignment or equation with a single function call on the right side. Got the following expression: (1, 2).
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
//
// Execution failed!
// endResult
22 changes: 22 additions & 0 deletions flattening/modelica/scodeinst/TupleInvalid2.mo
@@ -0,0 +1,22 @@
// name: TupleInvalid2
// keywords:
// status: incorrect
// cflags: -d=newInst
//

model TupleInvalid2
Real x;
Real y;
equation
(x, y) = (1, 2);
end TupleInvalid2;

// Result:
// Error processing file: TupleInvalid2.mo
// [flattening/modelica/scodeinst/TupleInvalid2.mo:11:3-11:18:writable] Error: Tuple expressions may only occur on the left side of an assignment or equation with a single function call on the right side. Got the following expression: (1, 2).
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
//
// Execution failed!
// endResult
22 changes: 22 additions & 0 deletions flattening/modelica/scodeinst/TupleInvalid3.mo
@@ -0,0 +1,22 @@
// name: TupleInvalid3
// keywords:
// status: incorrect
// cflags: -d=newInst
//

model TupleInvalid3
Real x;
Real y;
equation
(x, y) = {1, 2};
end TupleInvalid3;

// Result:
// Error processing file: TupleInvalid3.mo
// [flattening/modelica/scodeinst/TupleInvalid3.mo:11:3-11:18:writable] Error: Type mismatch in equation (x, y) = {1, 2} of type (Real, Real) = Integer[2].
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
//
// Execution failed!
// endResult

0 comments on commit 74ef35d

Please sign in to comment.