summaryrefslogtreecommitdiff
path: root/client/src
diff options
context:
space:
mode:
authorbscan <10503608+bscan@users.noreply.github.com>2022-02-28 22:18:24 -0500
committerbscan <10503608+bscan@users.noreply.github.com>2022-02-28 22:18:24 -0500
commit446e2e081be1bddfa4d49f873999d0ec7f3aff5b (patch)
tree09e47b5300af71d4bad9ffc0a21274231f5ccd1d /client/src
parentea1b5c7ac09743ae4f34fea1be03364600bd4dc1 (diff)
downloadPerlNavigator-446e2e081be1bddfa4d49f873999d0ec7f3aff5b.zip
Adding some tests
Diffstat (limited to 'client/src')
-rw-r--r--client/src/test/completion.test.ts10
-rw-r--r--client/src/test/diagnostics.test.ts9
2 files changed, 9 insertions, 10 deletions
diff --git a/client/src/test/completion.test.ts b/client/src/test/completion.test.ts
index 29786f1..af0a613 100644
--- a/client/src/test/completion.test.ts
+++ b/client/src/test/completion.test.ts
@@ -10,11 +10,11 @@ import { getDocUri, activate } from './helper';
suite('Should do completion', () => {
const docUri = getDocUri('mainTest.pl');
- test('Completes JS/TS in txt file', async () => {
- await testCompletion(docUri, new vscode.Position(0, 0), {
+ // Unfortunately, this test does not work yet
+ test('Test autocompletion', async () => {
+ await testCompletion(docUri, new vscode.Position(29, 23), {
items: [
- { label: 'JavaScript', kind: vscode.CompletionItemKind.Text },
- { label: 'TypeScript', kind: vscode.CompletionItemKind.Text }
+ { label: '$my_scalar', kind: vscode.CompletionItemKind.Variable },
]
});
});
@@ -34,7 +34,7 @@ async function testCompletion(
position
)) as vscode.CompletionList;
- assert.ok(actualCompletionList.items.length >= 2);
+ assert.ok(actualCompletionList.items.length == 1);
expectedCompletionList.items.forEach((expectedItem, i) => {
const actualItem = actualCompletionList.items[i];
assert.equal(actualItem.label, expectedItem.label);
diff --git a/client/src/test/diagnostics.test.ts b/client/src/test/diagnostics.test.ts
index 9683eef..fb47905 100644
--- a/client/src/test/diagnostics.test.ts
+++ b/client/src/test/diagnostics.test.ts
@@ -8,13 +8,12 @@ import * as assert from 'assert';
import { getDocUri, activate } from './helper';
suite('Should get diagnostics', () => {
- const docUri = getDocUri('mainTest.pl');
+ const docUri = getDocUri('MyLib/MyClass.pm');
- test('Diagnoses uppercase texts', async () => {
+ test('Checks perl compilation warnings', async () => {
await testDiagnostics(docUri, [
- { message: 'ANY is all uppercase.', range: toRange(0, 0, 0, 3), severity: vscode.DiagnosticSeverity.Warning, source: 'ex' },
- { message: 'ANY is all uppercase.', range: toRange(0, 14, 0, 17), severity: vscode.DiagnosticSeverity.Warning, source: 'ex' },
- { message: 'OS is all uppercase.', range: toRange(0, 18, 0, 20), severity: vscode.DiagnosticSeverity.Warning, source: 'ex' }
+ { message: 'Syntax: "my" variable $genWarning masks earlier declaration in same scope at /home/brian/github/PerlNavigator/testWorkspace/MyLib/MyClass.pm line 27.',
+ range: toRange(26, 0, 26, 500), severity: vscode.DiagnosticSeverity.Warning, source: 'perlnavigator' },
]);
});
});