Skip to content

Commit

Permalink
Update tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
perost authored and OpenModelica-Hudson committed Mar 15, 2018
1 parent f1296f3 commit b2e098b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 23 deletions.
13 changes: 7 additions & 6 deletions metamodelica/meta/AllWild.mos
Expand Up @@ -16,28 +16,29 @@ getErrorString();
// Real r1, r2, r3, r4, r5;
// end REC;
// end Union;
//
//
// function fn
// output Real r;
// algorithm
// r := match REC(1, 2, 3, 4, 5)
// case REC(__) then 6.0;
// end match;
// end fn;
//
//
// constant Real r = fn();
// end AllWild;"
// "function AllWild.fn
// output Real r;
// algorithm
// r := match (AllWild.Union.REC(#(1.0), #(2.0), #(3.0), #(4.0), #(5.0)))
// case (AllWild.Union.REC(_, _, _, _, _)) then 6.0;
// end match;
// case (AllWild.Union.REC(_, _, _, _, _)) then 6.0;
// end match;
// end AllWild.fn;
//
//
// class AllWild
// constant Real r = 6.0;
// end AllWild;
// "
// ""
// "[metamodelica/meta/AllWild.mo:10:5-10:63:writable] Notification: Match input AllWild.Union.REC(#(1.0), #(2.0), #(3.0), #(4.0), #(5.0)) is a constant value.
// "
// endResult
12 changes: 8 additions & 4 deletions metamodelica/meta/MatchDotNotation.mos
Expand Up @@ -23,13 +23,16 @@ MatchDotNotation.error5(0);getErrorString();
// true
// ""
// 2.0
// ""
// "[metamodelica/meta/MatchDotNotation.mo:19:3-26:12:writable] Notification: Match input MatchDotNotation.Union.REAL(#(rx)) is a constant value.
// "
// 4.0
// ""
// "[metamodelica/meta/MatchDotNotation.mo:33:3-40:12:writable] Notification: Match input MatchDotNotation.Union.REAL(#(r)) is a constant value.
// "
// 6.0
// ""
// 8.0
// ""
// "[metamodelica/meta/MatchDotNotation.mo:59:3-61:12:writable] Notification: Match input MatchDotNotation.Union.REAL(#(r)) is a constant value.
// "
//
// "[metamodelica/meta/MatchDotNotation.mo:74:9-74:24:writable] Error: Type mismatch in pattern x as REAL()
// expression type:
Expand All @@ -38,7 +41,8 @@ MatchDotNotation.error5(0);getErrorString();
// MatchDotNotation.Union.REAL
// "
// fail()
// ""
// "[metamodelica/meta/MatchDotNotation.mo:83:3-90:12:writable] Notification: Match input MatchDotNotation.Union.REAL(#(r)) is a constant value.
// "
//
// "[metamodelica/meta/MatchDotNotation.mo:102:9-102:24:writable] Error: Type mismatch in pattern x as _
// expression type:
Expand Down
30 changes: 17 additions & 13 deletions metamodelica/meta/OptimizeContinue.mo
Expand Up @@ -43,29 +43,33 @@ end OptimizeContinue;
// output Real r;
// algorithm
// r := match /* switch */ (OptimizeContinue.Ut.UT1())
// case (OptimizeContinue.Ut.UT1()) then 1.0;
// case (OptimizeContinue.Ut.UT2()) then 2.0;
// case (OptimizeContinue.Ut.UT3()) then 3.0;
// end match /* switch */;
// case (OptimizeContinue.Ut.UT1()) then 1.0;
// case (OptimizeContinue.Ut.UT2()) then 2.0;
// case (OptimizeContinue.Ut.UT3()) then 3.0;
// end match /* switch */;
// r := match (OptimizeContinue.Ut2.UT4(#(1)))
// case (OptimizeContinue.Ut2.UT4(1)) then 1.0;
// case (OptimizeContinue.Ut2.UT4(2)) then 2.0;
// end match;
// case (OptimizeContinue.Ut2.UT4(1)) then 1.0;
// case (OptimizeContinue.Ut2.UT4(2)) then 2.0;
// end match;
// r := matchcontinue (OptimizeContinue.Ut.UT1())
// case (OptimizeContinue.Ut.UT1()) then 1.0;
// case (OptimizeContinue.Ut.UT1()) then 2.0;
// end matchcontinue;
// case (OptimizeContinue.Ut.UT1()) then 1.0;
// case (OptimizeContinue.Ut.UT1()) then 2.0;
// end matchcontinue;
// r := matchcontinue (OptimizeContinue.Ut2.UT4(#(1)))
// case (OptimizeContinue.Ut2.UT4(1)) then 1.0;
// case (OptimizeContinue.Ut2.UT4(_)) then 2.0;
// end matchcontinue;
// case (OptimizeContinue.Ut2.UT4(1)) then 1.0;
// case (OptimizeContinue.Ut2.UT4(_)) then 2.0;
// end matchcontinue;
// end OptimizeContinue.f;
//
// class OptimizeContinue
// constant Real r = 1.0;
// end OptimizeContinue;
// [metamodelica/meta/OptimizeContinue.mo:21:5-25:22:writable] Notification: This matchcontinue expression has no overlapping patterns and should be using match instead of matchcontinue.
// [metamodelica/meta/OptimizeContinue.mo:21:5-25:22:writable] Notification: Converted match expression to switch of type #T_UNKNOWN#.
// [metamodelica/meta/OptimizeContinue.mo:21:5-25:22:writable] Notification: Match input OptimizeContinue.Ut.UT1() is a constant value.
// [metamodelica/meta/OptimizeContinue.mo:26:5-29:22:writable] Notification: This matchcontinue expression has no overlapping patterns and should be using match instead of matchcontinue.
// [metamodelica/meta/OptimizeContinue.mo:26:5-29:22:writable] Notification: Match input OptimizeContinue.Ut2.UT4(#(1)) is a constant value.
// [metamodelica/meta/OptimizeContinue.mo:30:5-33:22:writable] Notification: Match input OptimizeContinue.Ut.UT1() is a constant value.
// [metamodelica/meta/OptimizeContinue.mo:34:5-37:22:writable] Notification: Match input OptimizeContinue.Ut2.UT4(#(1)) is a constant value.
//
// endResult

0 comments on commit b2e098b

Please sign in to comment.