Skip to main content

module lang::flybytes::tests::OtherExpressionTests

rascal-0.42.0
org.rascalmpl.flybytes-0.2.11

Usage​

import lang::flybytes::tests::OtherExpressionTests;

Dependencies​

import lang::flybytes::Syntax;
import lang::flybytes::Compiler;

function incExpClass​

Class incExpClass()

function incStatClass​

Class incStatClass()

function newExpClass​

Class newExpClass()

function coerceTestClass​

Class coerceTestClass(Type from, Type to, Exp \in, Exp out)

Tests

test testInc​

test bool testInc() = loadClass(incExpClass())
.invokeStatic(methodDesc(boolean(), "testMethod", []), []).toValue(#bool);

test testIncStat​

test bool testIncStat() = loadClass(incStatClass())
.invokeStatic(methodDesc(boolean(), "testMethod", []), []).toValue(#bool);

test testNew​

test bool testNew() = loadClass(newExpClass())
.invokeStatic(methodDesc(boolean(), "testMethod", []), []).toValue(#bool);

test testCoerceIntDouble​

test bool testCoerceIntDouble()
= loadClass(coerceTestClass(\integer(), \double(), iconst(1), dconst(1.0)))
.invokeStatic(methodDesc(boolean(), "testMethod", []), []).toValue(#bool);

test testCoerceDoubleInt​

test bool testCoerceDoubleInt()
= loadClass(coerceTestClass(\double(), \integer(), dconst(0.0), iconst(0)))
.invokeStatic(methodDesc(boolean(), "testMethod", []), []).toValue(#bool);