Skip to main content

module lang::cpp::tests::AST

rascal-0.41.2
org.rascalmpl.clair-0.13.3

Usage

import lang::cpp::tests::AST;

Dependencies

extend lang::cpp::AST;
import analysis::m3::AST;
import List;
import util::Monitor;
import IO;

function testFiles

list[loc] testFiles()

function astContract

bool astContract()

Tests

test declTypeFeature

test bool declTypeFeature() {
t = parseCpp(|project://clair/src/test/declTypes.cpp|);

/* we expect at two qualified names with a computed type expression in it: */
computedNames = [q | /q:qualifiedName([decltypeName(Expression _), *_], _) := t];

/* and we expect three declarations where the type of the declared variable is computed */
computedTypes = [q | /q:declSpecifier(_, decltype(Expression _)) := t];

return size(computedNames) == 2 && size(computedTypes) == 3;
}