Skip to content

Commit

Permalink
Merge remote branch 'origin/master' into edge
Browse files Browse the repository at this point in the history
  • Loading branch information
automatic-merge committed Apr 23, 2024
2 parents ac5e73e + 5b57e54 commit 924a518
Showing 1 changed file with 37 additions and 41 deletions.
78 changes: 37 additions & 41 deletions integration/vscode/ada/test/suite/general/highlighting.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,57 +14,53 @@ suite('Highlighting', function () {
await activate();
});

this.afterEach(async function () {
await vscode.commands.executeCommand('workbench.action.closeActiveEditor');
});

test('file paths recovered', function () {
const highlightingTestRoot = getDocUri('src/highlighting').fsPath;
adaFilePaths = [];

function walk(dir: string) {
const openDir = opendirSync(dir);
try {
let child;
while ((child = openDir.readSync()) != null) {
const childPath = path.join(dir, child.name);
if (child.isDirectory()) {
walk(childPath);
} else if (child.isFile()) {
if (child.name.match(/\.ad[bs]$/)) {
adaFilePaths.push(childPath);
}
const highlightingTestRoot = getDocUri('src/highlighting').fsPath;
adaFilePaths = [];

function walk(dir: string) {
const openDir = opendirSync(dir);
try {
let child;
while ((child = openDir.readSync()) != null) {
const childPath = path.join(dir, child.name);
if (child.isDirectory()) {
walk(childPath);
} else if (child.isFile()) {
if (child.name.match(/\.ad[bs]$/)) {
adaFilePaths.push(childPath);
}
}
} finally {
openDir.closeSync();
}
} finally {
openDir.closeSync();
}
}

walk(highlightingTestRoot);
assert.notStrictEqual(adaFilePaths, []);
});
walk(highlightingTestRoot);
assert.notStrictEqual(adaFilePaths, []);

this.afterAll(function () {
for (const absPath of adaFilePaths) {
const testName = `${basename(dirname(absPath))}/${basename(absPath)}`;
const absFileUri = vscode.Uri.file(absPath);
for (const absPath of adaFilePaths) {
const testName = `${basename(dirname(absPath))}/${basename(absPath)}`;
const absFileUri = vscode.Uri.file(absPath);

suite(testName, function () {
test('syntax.main', function () {
testSyntaxHighlighting(absPath, 'syntaxes');
});
suite(testName, function () {
this.afterAll(async function () {
await vscode.commands.executeCommand('workbench.action.closeActiveEditor');
});

test('syntax.advanced', function () {
testSyntaxHighlighting(absPath, 'advanced');
});
test('syntax.main', function () {
testSyntaxHighlighting(absPath, 'syntaxes');
});

test('semantic', async function () {
await testSemanticHighlighting(absFileUri);
});
test('syntax.advanced', function () {
testSyntaxHighlighting(absPath, 'advanced');
});
}
});

test('semantic', async function () {
await testSemanticHighlighting(absFileUri);
});
});
}
});

/**
Expand Down

0 comments on commit 924a518

Please sign in to comment.