module lang::flybytes::tests::VariableTests
rascal-0.40.17
flybytes-0.2.8
Usage
import lang::flybytes::tests::VariableTests;
Source code
http://github.com/usethesource/flybytes/blob/main/src/lang/flybytes/tests/VariableTests.rsc
Dependencies
import lang::flybytes::Syntax;
import lang::flybytes::Compiler;
import lang::flybytes::api::Object;
import lang::flybytes::api::JavaLang;
import Node;
import util::Math;
function primVarTestClass
Class primVarTestClass(Type t, value v)
function testVarClass
bool testVarClass(Class c)
function fit
real fit(float(), real r)
real fit(double(), real r)
function objVarTestClass
Class objVarTestClass(Type t, Exp v)
Tests
test intVariables
test bool intVariables(int i)
= all(t <- intTypes, I := i % maxIntValue(t), testVarClass(primVarTestClass(t, I)));
test floatVariables
test bool floatVariables(real i)
= all(t <- floatTypes, I := fit(t, i), testVarClass(primVarTestClass(t, I)));
test boolVariableTrue
test bool boolVariableTrue() = testVarClass(primVarTestClass(boolean(), true));
test boolVariableFalse
test bool boolVariableFalse() = testVarClass(primVarTestClass(boolean(), false));
test stringVariable
test bool stringVariable() = testVarClass(objVarTestClass(string(), sconst("Hello")));