Skip to content

Commit

Permalink
cleaned up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joecrop committed Jan 8, 2024
1 parent 97ae294 commit 4714086
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions src/test/ModuleInstantiator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,14 @@ suite('ModuleInstantiator Tests', () => {

let fullRange = null;
// Range of the module in the document
fullRange = new vscode.Range(new vscode.Position(301, 6), new vscode.Position(325, 0));
fullRange = new vscode.Range(new vscode.Position(300, 6), new vscode.Position(324, 0));

let container = document.getText(fullRange).replace(/^\s+|\s+$/g, '');

uri = vscode.Uri.file(path.join(__dirname, testFolderLocation, 'test-files', 'ModuleInstantiator.test.2.v'));
document = await vscode.workspace.openTextDocument(uri);

fullRange = new vscode.Range(new vscode.Position(138, 0), new vscode.Position(147, 0));
fullRange = new vscode.Range(new vscode.Position(137, 0), new vscode.Position(146, 0));

let instance = document.getText(fullRange);

Expand All @@ -226,7 +226,7 @@ suite('ModuleInstantiator Tests', () => {

let fullRange = null;
// Range of the module in the document
fullRange = new vscode.Range(new vscode.Position(152, 6), new vscode.Position(164, 0));
fullRange = new vscode.Range(new vscode.Position(328, 6), new vscode.Position(353, 0));

let container = document.getText(fullRange).replace(/^\s+|\s+$/g, '');

Expand Down
22 changes: 11 additions & 11 deletions src/test/indexer_map.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ suite('indexer_map Tests', () => {
assert.strictEqual(symbols.size, 4);
let count = await indexer.addDocumentSymbols(sVDocument, symbols);

assert.strictEqual(count, 8);
assert.strictEqual(count, 10);
assert.strictEqual(symbols.size, 5);
assert.strictEqual(symbols.get(uri.fsPath).length, 8);
assert.strictEqual(getSymbolsCount(), 21);
assert.strictEqual(symbols.get(uri.fsPath).length, 10);
assert.strictEqual(getSymbolsCount(), 23);

documentSymbols.forEach((symbolName) => {
if (!symbolExists(symbolName)) {
Expand All @@ -47,28 +47,28 @@ suite('indexer_map Tests', () => {
assert.strictEqual(count, 0);
assert.strictEqual(symbols.size, 5);
assert.strictEqual(symbols.get(nonSVUri.fsPath), undefined);
assert.strictEqual(getSymbolsCount(), 21);
assert.strictEqual(getSymbolsCount(), 23);

// undefined/null document
count = await indexer.addDocumentSymbols(undefined, symbols);
assert.strictEqual(count, 0);
assert.strictEqual(symbols.size, 5);
assert.strictEqual(getSymbolsCount(), 21);
assert.strictEqual(getSymbolsCount(), 23);

count = await indexer.addDocumentSymbols(sVDocument, undefined);
assert.strictEqual(count, 0);
assert.strictEqual(symbols.size, 5);
assert.strictEqual(getSymbolsCount(), 21);
assert.strictEqual(getSymbolsCount(), 23);

count = await indexer.addDocumentSymbols(undefined, undefined);
assert.strictEqual(count, 0);
assert.strictEqual(symbols.size, 5);
assert.strictEqual(getSymbolsCount(), 21);
assert.strictEqual(getSymbolsCount(), 23);

count = await indexer.addDocumentSymbols(null, symbols);
assert.strictEqual(count, 0);
assert.strictEqual(symbols.size, 5);
assert.strictEqual(getSymbolsCount(), 21);
assert.strictEqual(getSymbolsCount(), 23);
});

test('test #2: removeDocumentSymbols', async () => {
Expand All @@ -80,9 +80,9 @@ suite('indexer_map Tests', () => {
assert.strictEqual(symbols.size, 4);
let count = await indexer.addDocumentSymbols(sVDocument, symbols);

assert.strictEqual(count, 8);
assert.strictEqual(count, 10);
assert.strictEqual(symbols.size, 5);
assert.strictEqual(getSymbolsCount(), 21);
assert.strictEqual(getSymbolsCount(), 23);

count = indexer.removeDocumentSymbols(sVDocument.uri.fsPath, symbols);

Expand All @@ -92,7 +92,7 @@ suite('indexer_map Tests', () => {
}
});

assert.strictEqual(count, -8);
assert.strictEqual(count, -10);
assert.strictEqual(symbols.size, 4);
assert.strictEqual(getSymbolsCount(), 13);

Expand Down
12 changes: 6 additions & 6 deletions src/test/test-files/ModuleInstantiator.test.2.v
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ golden u_golden (
// ---------------------------------------------------------------

arrer u_arrer (
.clk (clk),
.reset (reset),
.a (a),
.b (b),
.valid (valid),
.c (c)
.clk (clk),
.reset (reset),
.a (a),
.b (b),
.valid (valid),
.c (c)
);


Expand Down

0 comments on commit 4714086

Please sign in to comment.