Skip to main content

module examples::calc::Test

rascal-0.34.0
typepal-0.8.10

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);
}

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");
}