Skip to content

Commit

Permalink
Self review
Browse files Browse the repository at this point in the history
  • Loading branch information
ncordon committed Jan 23, 2025
1 parent 6c98b22 commit 07f20b7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/language-support/src/tests/signatureHelp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ describe('Procedures signature help', () => {
);
});

test('Signature help depends on cypher version', () => {
test('Procedures signature help depends on cypher version', () => {
const dbSchema = {
functions: {},
procedures: {
Expand Down Expand Up @@ -440,7 +440,7 @@ describe('Functions signature help', () => {
);
});

test('Signature help depends on cypher version', () => {
test('Functions signature help depends on cypher version', () => {
const dbSchema = {
procedures: {},
functions: {
Expand Down
14 changes: 10 additions & 4 deletions packages/vscode-extension/tests/specs/api/syntaxValidation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ type InclusionTestArgs = {
expected: vscode.Diagnostic[];
};

function rangeToString(range: vscode.Range) {
return `${range.start.line}:${range.start.character} to ${range.end.line}:${range.end.character}`;
}

export async function testSyntaxValidation({
docUri,
expected,
Expand All @@ -36,24 +40,26 @@ export async function testSyntaxValidation({
assert.equal(
diagnostics.length,
expected.length,
`Different length for the diagnostics ${diagnostics.length} vs ${expected.length}`,
`Different length for the diagnostics. Actual: ${diagnostics.length} vs expected: ${expected.length}`,
);
diagnostics.forEach((diagnostic, i) => {
const expectedDiagnostic = expected[i];
assert.equal(
diagnostic.message,
expectedDiagnostic.message,
'Different message',
`Different message. Actual: ${diagnostic.message} vs expected: ${expectedDiagnostic.message}`,
);
assert.deepEqual(
diagnostic.range,
expectedDiagnostic.range,
`Different Range`,
`Different Range. Actual: ${rangeToString(
diagnostic.range,
)} vs expected: ${rangeToString(expectedDiagnostic.range)}`,
);
assert.equal(
diagnostic.severity,
expectedDiagnostic.severity,
'Different Severity',
`Different Severity ${diagnostic.severity} vs expected: ${expectedDiagnostic.severity}`,
);
});
resolve();
Expand Down

0 comments on commit 07f20b7

Please sign in to comment.