public class org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestIfCompiled extends org.finos.legend.pure.m.tests.AbstractPureTestWithCoreCompiled
{
public void <init>()
{
org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestIfCompiled v;
v := @this: org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestIfCompiled;
specialinvoke v.<org.finos.legend.pure.m.tests.AbstractPureTestWithCoreCompiled: void <init>()>();
return;
}
public static void setUp()
{
org.finos.legend.pure.m.coreinstance.CoreInstanceFactoryRegistry v;
org.finos.legend.pure.m.execution.FunctionExecution v;
v = staticinvoke <org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestIfCompiled: org.finos.legend.pure.m.execution.FunctionExecution getFunctionExecution()>();
v = staticinvoke <org.finos.legend.pure.runtime.java.compiled.factory.JavaModelFactoryRegistryLoader: org.finos.legend.pure.m.coreinstance.CoreInstanceFactoryRegistry loader()>();
staticinvoke <org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestIfCompiled: void setUpRuntime(org.finos.legend.pure.m.execution.FunctionExecution,org.finos.legend.pure.m.coreinstance.CoreInstanceFactoryRegistry)>(v, v);
return;
}
public void cleanRuntime()
{
org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestIfCompiled v;
org.finos.legend.pure.m.serialization.runtime.PureRuntime v, v;
v := @this: org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestIfCompiled;
v = <org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestIfCompiled: 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.compiled.generation.processors.support.function.base.lang.TestIfCompiled: 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 testUnAssignedIfInFuncExpression()
{
org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestIfCompiled v;
v := @this: org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestIfCompiled;
staticinvoke <org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestIfCompiled: org.finos.legend.pure.m.SourceMutation compileTestSource(java.lang.String,java.lang.String)>("fromString.pure", "function meta::pure::functions::lang::tests::if::testUnAssignedIfInFuncExpression():String[1]\n{\n   let ifVar =  if(true, | let b = \'true\', | if(true, | let b = \'true\', | \'false\'););\n   if(true, | let b = \'true\', | if(true, | let b = \'true\', | \'false\'););\n   if(true, | let b = \'true\', | if(true, | let b = \'true\', | \'false\'););\n   let iff = if(true, | let b = \'true\', | if(true, | let b = \'true\', | \'false\'););\n   if(true, | let b = \'true\'; if(true, | let b = \'true\', | \'false\'); let bb = \'bb\';, | let c = \'see\');\n   let a = \'be\';\n   if(true, | let b = \'true\', | \'false\');\n}");
return;
}
public void testIfWithDifferentMultiplicities()
{
org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestIfCompiled v;
v := @this: org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestIfCompiled;
staticinvoke <org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestIfCompiled: org.finos.legend.pure.m.SourceMutation compileTestSource(java.lang.String,java.lang.String)>("fromString.pure", "Class A\n{\n  id : Integer[1];\n}\n\nfunction testFn(ids:Integer[*]):A[*]\n{\n  if ($ids->isEmpty(),\n      | let id = -1;\n        ^A(id=$id);,\n      | let newIds = $ids->tail();\n        $ids->map(id | $newIds->testFn());)\n}");
return;
}
public void testIfWithFloatVersusInteger()
{
java.lang.Double v;
org.eclipse.collections.api.RichIterable v, v, v, v;
java.lang.Long v;
org.finos.legend.pure.m.serialization.runtime.PureRuntime v, v;
org.finos.legend.pure.m.coreinstance.CoreInstance v, v, v, v;
org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestIfCompiled v;
org.eclipse.collections.api.list.ImmutableList v, v;
java.lang.Object v, v;
org.eclipse.collections.api.factory.list.ImmutableListFactory v, v;
org.finos.legend.pure.m.execution.FunctionExecution v, v;
v := @this: org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestIfCompiled;
staticinvoke <org.finos.legend.pure.m.tests.AbstractPureTestWithCoreCompiled: org.finos.legend.pure.m.SourceMutation compileTestSource(java.lang.String,java.lang.String)>("fromString.pure", "import test::*;\nfunction test::testFn(test:Boolean[1]):Number[1]\n{\n    let result = if($test, |1.0, |3);\n    $result;\n}\n\nfunction test::testTrue():Any[*]\n{\n  let result = testFn(true);\n  assert(1.0 == $result, |\'\');\n  $result;\n}\n\nfunction test::testFalse():Any[*]\n{\n  let result = testFn(false);\n  assert(3 == $result, |\'\');\n  $result;\n}\n");
v = <org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestIfCompiled: org.finos.legend.pure.m.serialization.runtime.PureRuntime runtime>;
v = virtualinvoke v.<org.finos.legend.pure.m.serialization.runtime.PureRuntime: org.finos.legend.pure.m.coreinstance.CoreInstance getFunction(java.lang.String)>("test::testTrue():Any[*]");
staticinvoke <org.junit.Assert: void assertNotNull(java.lang.Object)>(v);
v = <org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestIfCompiled: org.finos.legend.pure.m.execution.FunctionExecution functionExecution>;
v = <org.eclipse.collections.api.factory.Lists: org.eclipse.collections.api.factory.list.ImmutableListFactory immutable>;
v = interfaceinvoke v.<org.eclipse.collections.api.factory.list.ImmutableListFactory: org.eclipse.collections.api.list.ImmutableList empty()>();
v = interfaceinvoke v.<org.finos.legend.pure.m.execution.FunctionExecution: org.finos.legend.pure.m.coreinstance.CoreInstance start(org.finos.legend.pure.m.coreinstance.CoreInstance,org.eclipse.collections.api.list.ListIterable)>(v, v);
staticinvoke <org.eclipse.collections.impl.test.Verify: void assertInstanceOf(java.lang.Class,java.lang.Object)>(class "Lorg/finos/legend/pure/m3/coreinstance/meta/pure/metamodel/valuespecification/InstanceValue;", v);
v = interfaceinvoke v.<org.finos.legend.pure.m.coreinstance.meta.pure.metamodel.valuespecification.InstanceValue: org.eclipse.collections.api.RichIterable _values()>();
staticinvoke <org.eclipse.collections.impl.test.Verify: void assertSize(int,java.lang.Iterable)>(1, v);
v = interfaceinvoke v.<org.finos.legend.pure.m.coreinstance.meta.pure.metamodel.valuespecification.InstanceValue: org.eclipse.collections.api.RichIterable _values()>();
v = interfaceinvoke v.<org.eclipse.collections.api.RichIterable: java.lang.Object getFirst()>();
staticinvoke <org.eclipse.collections.impl.test.Verify: void assertInstanceOf(java.lang.Class,java.lang.Object)>(class "Ljava/lang/Double;", v);
v = staticinvoke <java.lang.Double: java.lang.Double valueOf(double)>(1.0);
staticinvoke <org.junit.Assert: void assertEquals(java.lang.Object,java.lang.Object)>(v, v);
v = <org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestIfCompiled: org.finos.legend.pure.m.serialization.runtime.PureRuntime runtime>;
v = virtualinvoke v.<org.finos.legend.pure.m.serialization.runtime.PureRuntime: org.finos.legend.pure.m.coreinstance.CoreInstance getFunction(java.lang.String)>("test::testFalse():Any[*]");
staticinvoke <org.junit.Assert: void assertNotNull(java.lang.Object)>(v);
v = <org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestIfCompiled: org.finos.legend.pure.m.execution.FunctionExecution functionExecution>;
v = <org.eclipse.collections.api.factory.Lists: org.eclipse.collections.api.factory.list.ImmutableListFactory immutable>;
v = interfaceinvoke v.<org.eclipse.collections.api.factory.list.ImmutableListFactory: org.eclipse.collections.api.list.ImmutableList empty()>();
v = interfaceinvoke v.<org.finos.legend.pure.m.execution.FunctionExecution: org.finos.legend.pure.m.coreinstance.CoreInstance start(org.finos.legend.pure.m.coreinstance.CoreInstance,org.eclipse.collections.api.list.ListIterable)>(v, v);
staticinvoke <org.eclipse.collections.impl.test.Verify: void assertInstanceOf(java.lang.Class,java.lang.Object)>(class "Lorg/finos/legend/pure/m3/coreinstance/meta/pure/metamodel/valuespecification/InstanceValue;", v);
v = interfaceinvoke v.<org.finos.legend.pure.m.coreinstance.meta.pure.metamodel.valuespecification.InstanceValue: org.eclipse.collections.api.RichIterable _values()>();
staticinvoke <org.eclipse.collections.impl.test.Verify: void assertSize(int,java.lang.Iterable)>(1, v);
v = interfaceinvoke v.<org.finos.legend.pure.m.coreinstance.meta.pure.metamodel.valuespecification.InstanceValue: org.eclipse.collections.api.RichIterable _values()>();
v = interfaceinvoke v.<org.eclipse.collections.api.RichIterable: java.lang.Object getFirst()>();
staticinvoke <org.eclipse.collections.impl.test.Verify: void assertInstanceOf(java.lang.Class,java.lang.Object)>(class "Ljava/lang/Long;", v);
v = staticinvoke <java.lang.Long: java.lang.Long valueOf(long)>(3L);
staticinvoke <org.junit.Assert: void assertEquals(java.lang.Object,java.lang.Object)>(v, v);
return;
}
public static org.finos.legend.pure.m.execution.FunctionExecution getFunctionExecution()
{
org.finos.legend.pure.runtime.java.compiled.execution.FunctionExecutionCompiled v;
org.finos.legend.pure.runtime.java.compiled.execution.FunctionExecutionCompiledBuilder v;
v = new org.finos.legend.pure.runtime.java.compiled.execution.FunctionExecutionCompiledBuilder;
specialinvoke v.<org.finos.legend.pure.runtime.java.compiled.execution.FunctionExecutionCompiledBuilder: void <init>()>();
v = virtualinvoke v.<org.finos.legend.pure.runtime.java.compiled.execution.FunctionExecutionCompiledBuilder: org.finos.legend.pure.runtime.java.compiled.execution.FunctionExecutionCompiled build()>();
return v;
}
}