Skip to main content

module lang::cpp::tests::AST

rascal-0.40.17
clair-0.13.1

Usage

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

Source code

http://github.com/usethesource/clair/blob/main/src/lang/cpp/tests/AST.rsc

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