-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refac functionalities + definitions testing
- Loading branch information
Showing
6 changed files
with
70 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import * as assert from 'assert' | ||
import { commands, Location, LocationLink, Position, Range, Uri } from 'vscode' | ||
import { activate, getDocumentURI } from './helper' | ||
|
||
/** ATTENTION | ||
* These tests are NOT ATOMIC, they depend on each other, order matters. (Resolve TODO) | ||
* */ | ||
test('go to definition', async () => { | ||
const definitionURI = getDocumentURI('definition.wlk') | ||
await testDefinition(definitionURI, new Position(8, 8), [ | ||
new Location(definitionURI, new Range(new Position(0, 0), new Position(6, 0))), | ||
]) | ||
}) | ||
|
||
|
||
async function testDefinition(uri: Uri, at: Position, expected: Array<Location | LocationLink>): Promise<void> { | ||
await activate(uri) | ||
const result = await commands.executeCommand('vscode.executeDefinitionProvider', uri, at) | ||
uri['_formatted'] = null | ||
assert.deepEqual(result, expected) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
object pepita { | ||
method vola() { | ||
|
||
} | ||
} | ||
|
||
object manolo { | ||
method hacerVolarAPepita() { | ||
pepita.vola() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters