Skip to main content

module examples::struct::Test

rascal-0.40.16
typepal-0.14.8

Usage

import examples::struct::Test;

Source code

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

Dependencies

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

function structTModelForTree

TModel structTModelForTree(Tree pt){
return collectAndSolve(pt, config = structConfig(), modelName="struct");
}

function structTModelFromName

TModel structTModelFromName(str mname){
pt = parse(#start[Program], |project://typepal/src/examples/struct/<mname>.struct|).top;
return structTModelForTree(pt);
}

function main

value main()
= structTests();

Tests

test structTests

test bool structTests() {
return runTests([|project://typepal/src/examples/struct/tests.ttl|],
#start[Program],
TModel (Tree t) { return structTModelForTree(t); },
runName = "Struct");
}