public class org.finos.legend.pure.runtime.java.interpreted.function.TestParameters extends org.finos.legend.pure.m.tests.AbstractPureTestWithCoreCompiled
{
public void <init>()
{
org.finos.legend.pure.runtime.java.interpreted.function.TestParameters v;
v := @this: org.finos.legend.pure.runtime.java.interpreted.function.TestParameters;
specialinvoke v.<org.finos.legend.pure.m.tests.AbstractPureTestWithCoreCompiled: void <init>()>();
return;
}
public static void setUp()
{
org.finos.legend.pure.m.execution.FunctionExecution v;
v = staticinvoke <org.finos.legend.pure.runtime.java.interpreted.function.TestParameters: org.finos.legend.pure.m.execution.FunctionExecution getFunctionExecution()>();
staticinvoke <org.finos.legend.pure.runtime.java.interpreted.function.TestParameters: void setUpRuntime(org.finos.legend.pure.m.execution.FunctionExecution)>(v);
return;
}
public void cleanRuntime()
{
org.finos.legend.pure.m.serialization.runtime.PureRuntime v, v;
org.finos.legend.pure.runtime.java.interpreted.function.TestParameters v;
v := @this: org.finos.legend.pure.runtime.java.interpreted.function.TestParameters;
v = <org.finos.legend.pure.runtime.java.interpreted.function.TestParameters: org.finos.legend.pure.m.serialization.runtime.PureRuntime runtime>;
virtualinvoke v.<org.finos.legend.pure.m.serialization.runtime.PureRuntime: void delete(java.lang.String)>("fromString.pure");
v = <org.finos.legend.pure.runtime.java.interpreted.function.TestParameters: org.finos.legend.pure.m.serialization.runtime.PureRuntime runtime>;
virtualinvoke v.<org.finos.legend.pure.m.serialization.runtime.PureRuntime: org.finos.legend.pure.m.SourceMutation compile()>();
return;
}
public void testFunctionParametersTypes()
{
org.finos.legend.pure.runtime.java.interpreted.function.TestParameters v;
java.lang.Integer v, v;
java.lang.Exception v;
v := @this: org.finos.legend.pure.runtime.java.interpreted.function.TestParameters;
label:
staticinvoke <org.finos.legend.pure.runtime.java.interpreted.function.TestParameters: org.finos.legend.pure.m.SourceMutation compileTestSource(java.lang.String,java.lang.String)>("fromString.pure", "function called(param:Integer[1]):Nil[0]\n{\n   print($param, 1);\n}\nfunction test():Nil[0]\n{\n    called(\'aaa\');\n}\n");
staticinvoke <org.junit.Assert: void fail()>();
label:
goto label;
label:
v := @caughtexception;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(7);
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(5);
virtualinvoke v.<org.finos.legend.pure.runtime.java.interpreted.function.TestParameters: void assertPureException(java.lang.Class,java.lang.String,java.lang.Integer,java.lang.Integer,java.lang.Exception)>(class "Lorg/finos/legend/pure/m4/exception/PureCompilationException;", "The system can\'t find a match for the function: called(_:String[1])\n\nThese functions, in packages already imported, would match the function call if you changed the parameters.\n\tcalled(Integer[1]):Nil[0]\n\nNo functions, in packages not imported, match the function name.\n", v, v, v);
label:
return;
catch java.lang.Exception from label to label with label;
}
public void testFunctionParametersNestedValidation()
{
org.finos.legend.pure.m.coreinstance.CoreInstance[] v;
org.finos.legend.pure.runtime.java.interpreted.function.TestParameters v;
java.lang.Integer v, v;
java.lang.Exception v;
v := @this: org.finos.legend.pure.runtime.java.interpreted.function.TestParameters;
label:
staticinvoke <org.finos.legend.pure.runtime.java.interpreted.function.TestParameters: org.finos.legend.pure.m.SourceMutation compileTestSource(java.lang.String,java.lang.String)>("fromString.pure", "Class Employee\n{\n    name:String[1];\n}\nfunction called(employee:Employee[1]):Nil[0]\n{\n   print($employee, 1);\n}\nfunction test():Nil[0]\n{\n    called(^Employee(name=[\'ee\',\'err\']));\n}\n");
v = newarray (org.finos.legend.pure.m.coreinstance.CoreInstance)[0];
virtualinvoke v.<org.finos.legend.pure.runtime.java.interpreted.function.TestParameters: org.finos.legend.pure.m.coreinstance.CoreInstance execute(java.lang.String,org.finos.legend.pure.m.coreinstance.CoreInstance[])>("test():Nil[0]", v);
staticinvoke <org.junit.Assert: void fail()>();
label:
goto label;
label:
v := @caughtexception;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(11);
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(26);
virtualinvoke v.<org.finos.legend.pure.runtime.java.interpreted.function.TestParameters: void assertOriginatingPureException(java.lang.Class,java.lang.String,java.lang.Integer,java.lang.Integer,java.lang.Exception)>(class "Lorg/finos/legend/pure/m4/exception/PureCompilationException;", "Multiplicity Error: [2] is not compatible with [1]", v, v, v);
label:
return;
catch java.lang.Exception from label to label with label;
}
public void testFunctionParameterTypeError()
{
org.finos.legend.pure.runtime.java.interpreted.function.TestParameters v;
java.lang.Integer v, v;
java.lang.Exception v;
v := @this: org.finos.legend.pure.runtime.java.interpreted.function.TestParameters;
label:
staticinvoke <org.finos.legend.pure.runtime.java.interpreted.function.TestParameters: org.finos.legend.pure.m.SourceMutation compileTestSource(java.lang.String,java.lang.String)>("fromString.pure", "function test():Nil[0]\n{\n    print(a:String[1]|\'a\'+$a->eval(\'errre\'));\n}\n");
staticinvoke <org.junit.Assert: void fail()>();
label:
goto label;
label:
v := @caughtexception;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(3);
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(31);
virtualinvoke v.<org.finos.legend.pure.runtime.java.interpreted.function.TestParameters: void assertPureException(java.lang.Class,java.lang.String,java.lang.Integer,java.lang.Integer,java.lang.Exception)>(class "Lorg/finos/legend/pure/m4/exception/PureCompilationException;", "The system can\'t find a match for the function: eval(_:String[1],_:String[1])\n\nNo functions, in packages already imported, match the function name.\n\nThese functions, in packages not imported, match the function name. Add the package to imports so that the function is in scope.\n\tmeta::pure::functions::lang::eval(Function<{->V[m]}>[1]):V[m]\n\tmeta::pure::functions::lang::eval(Function<{S[n], T[o], U[p], W[q], X[r], Y[s], Z[t]->V[m]}>[1], S[n], T[o], U[p], W[q], X[r], Y[s], Z[t]):V[m]\n\tmeta::pure::functions::lang::eval(Function<{T[n], U[p], W[q], X[r], Y[s], Z[t]->V[m]}>[1], T[n], U[p], W[q], X[r], Y[s], Z[t]):V[m]\n\tmeta::pure::functions::lang::eval(Function<{T[n], U[p], W[q], X[r], Y[s]->V[m]}>[1], T[n], U[p], W[q], X[r], Y[s]):V[m]\n\tmeta::pure::functions::lang::eval(Function<{T[n], U[p], W[q], X[r]->V[m]}>[1], T[n], U[p], W[q], X[r]):V[m]\n\tmeta::pure::functions::lang::eval(Function<{T[n], U[p], W[q]->V[m]}>[1], T[n], U[p], W[q]):V[m]\n\tmeta::pure::functions::lang::eval(Function<{T[n], U[p]->V[m]}>[1], T[n], U[p]):V[m]\n\tmeta::pure::functions::lang::eval(Function<{T[n]->V[m]}>[1], T[n]):V[m]\n", v, v, v);
label:
return;
catch java.lang.Exception from label to label with label;
}
protected static org.finos.legend.pure.m.execution.FunctionExecution getFunctionExecution()
{
org.finos.legend.pure.runtime.java.interpreted.FunctionExecutionInterpreted v;
v = new org.finos.legend.pure.runtime.java.interpreted.FunctionExecutionInterpreted;
specialinvoke v.<org.finos.legend.pure.runtime.java.interpreted.FunctionExecutionInterpreted: void <init>()>();
return v;
}
}