module lang::flybytes::tests::OtherExpressionTests
rascal-0.40.17
flybytes-0.2.8
Usage
import lang::flybytes::tests::OtherExpressionTests;
Source code
http://github.com/usethesource/flybytes/blob/main/src/lang/flybytes/tests/OtherExpressionTests.rsc
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);