module examples::evenOdd::Test
rascal-0.40.16
typepal-0.14.8
Usage
import examples::evenOdd::Test;
Source code
http://github.com/usethesource/typepal/src/examples/evenOdd/Test.rsc
Dependencies
import examples::evenOdd::Syntax;
extend examples::evenOdd::Checker;
extend analysis::typepal::TestFramework;
import ParseTree;
function evenOddTModelForTree
TModel evenOddTModelForTree(Tree pt){
if(pt has top) pt = pt.top;
c = newCollector("even-odd", pt, tconfig());
collect(pt, c);
return newSolver(pt, c.run()).run();
}
function evenOddTModelFromStr
TModel evenOddTModelFromStr(str text){
pt = parse(#start[EvenOdd], text).top;
return evenOddTModelForTree(pt);
}
function main
value main() {
return evenOddTests();
}
Tests
test evenOddTests
test bool evenOddTests() {
return runTests([|project://typepal/src/examples/evenOdd/tests.ttl|],
#EvenOdd,
evenOddTModelForTree,
runName="EvenOdd");
}