Skip to content

Commit

Permalink
Add tests for current cases
Browse files Browse the repository at this point in the history
Specifically this covers some basic cases as well as the
reproductions of microsoft#1638 and microsoft#1033 plus the variant of microsoft#1033 which
always worked.
  • Loading branch information
PeterJCLaw committed May 19, 2018
1 parent ea40cac commit d1e5eb9
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions src/test/definitions/navigation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,60 @@ suite('Definition Navigation', () => {
fileDefinitions,
new vscode.Range(2, 0, 11, 17)
));

test('Function decorated by stdlib', buildTest(
fileDefinitions,
new vscode.Position(29, 6),
fileDefinitions,
new vscode.Range(21, 0, 27, 17)
));

test('Function decorated by local decorator', buildTest(
fileDefinitions,
new vscode.Position(30, 6),
fileDefinitions,
new vscode.Range(14, 0, 18, 7)
));

test('Module imported decorator usage', buildTest(
fileUsages,
new vscode.Position(3, 15),
fileDefinitions,
new vscode.Range(2, 0, 11, 17)
));

test('Module imported function decorated by stdlib', buildTest(
fileUsages,
new vscode.Position(11, 19),
fileDefinitions,
new vscode.Range(21, 0, 27, 17)
));

test('Module imported function decorated by local decorator', buildTest(
fileUsages,
new vscode.Position(12, 19),
fileDefinitions,
new vscode.Range(14, 0, 18, 7)
));

test('Specifically imported decorator usage', buildTest(
fileUsages,
new vscode.Position(7, 1),
fileDefinitions,
new vscode.Range(2, 0, 11, 17)
));

test('Specifically imported function decorated by stdlib', buildTest(
fileUsages,
new vscode.Position(14, 6),
fileDefinitions,
new vscode.Range(21, 0, 27, 17)
));

test('Specifically imported function decorated by local decorator', buildTest(
fileUsages,
new vscode.Position(15, 6),
fileDefinitions,
new vscode.Range(14, 0, 18, 7)
));
});

0 comments on commit d1e5eb9

Please sign in to comment.