Skip to content

Commit

Permalink
Add test for OM ticket #3005
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed Feb 25, 2016
1 parent c8ee0c3 commit bd38afd
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions metamodelica/meta/Makefile
Expand Up @@ -105,6 +105,7 @@ StringBoxed.mos \
SwitchString.mos \
TailRecursion.mo \
TailRecursionNoretcall.mos \
Ticket3005.mos \
ThreadedReduction.mos \
Try.mos \
TupleInteractive.mos \
Expand Down
47 changes: 47 additions & 0 deletions metamodelica/meta/Ticket3005.mos
@@ -0,0 +1,47 @@
// status: correct

setCommandLineOptions("-g=MetaModelica");getErrorString();
loadString("
package P
constant Integer n = 1;
constant list<Integer> nl = {1,2};

function f
input Integer x;
output Boolean eq;
algorithm
eq := match x
case n then true;
else false;
end match;
end f;

function flst
input list<Integer> x;
output Boolean eq;
algorithm
eq := match x
case nl then true;
else false;
end match;
end flst;

end P;

function test
input Integer x;
output Boolean eq;
algorithm
eq := P.f(x) and P.flst({x,2*x});
end test;
");getErrorString();
test(1) and not test(2);getErrorString();

// Result:
// true
// ""
// true
// ""
// true
// ""
// endResult

0 comments on commit bd38afd

Please sign in to comment.