Skip to main content

module examples::calc::Test

rascal-0.40.16
typepal-0.14.8

Usage

import examples::calc::Test;

Source code

http://github.com/usethesource/typepal/src/examples/calc/Test.rsc

Dependencies

import examples::calc::Syntax;
extend examples::calc::Checker;
extend analysis::typepal::TestFramework;
import ParseTree;

function calcTModelForTree

TModel calcTModelForTree(Tree pt){
return collectAndSolve(pt, modelName = "calc");
}

function calcTModelFromStr

TModel calcTModelFromStr(str text){
pt = parse(#start[Calc], text).top;
return calcTModelForTree(pt);
}

function main

bool main() = calcTests();

Tests

test calcTests

test bool calcTests() {
return runTests([|project://typepal/src/examples/calc/tests.ttl|],
#Calc,
calcTModelForTree,
runName="Calc");
}