mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 02:30:15 -06:00
Add test harnesses
This commit is contained in:
parent
6d174a0f18
commit
38005e7174
@ -1942,6 +1942,18 @@ module FourSlash {
|
||||
}
|
||||
}
|
||||
|
||||
public verfiyDocCommentScaffolding(position: number, expected: ts.TextInsertion) {
|
||||
let actual = this.languageService.getDocCommentScaffoldingAtPosition(this.activeFile.fileName, position);
|
||||
|
||||
if (actual.newText !== expected.newText) {
|
||||
this.raiseError('verfiyDocCommentScaffolding failed - expected insertion:\n' + expected.newText + 'actual insertion:\n' + actual.newText);
|
||||
}
|
||||
|
||||
if (actual.cursorOffset !== expected.cursorOffset) {
|
||||
this.raiseError('verfiyDocCommentScaffolding failed - expected cursorOffset: ' + expected.cursorOffset + ',\tactual cursorOffset:' + actual.cursorOffset);
|
||||
}
|
||||
}
|
||||
|
||||
public verifyMatchingBracePosition(bracePosition: number, expectedMatchPosition: number) {
|
||||
this.taoInvalidReason = 'verifyMatchingBracePosition NYI';
|
||||
|
||||
|
||||
@ -541,7 +541,7 @@ namespace ts.server {
|
||||
throw new Error("Not Implemented Yet.");
|
||||
}
|
||||
|
||||
getDocCommentScaffoldingAtPosition(fileName: string, position: number): string {
|
||||
getDocCommentScaffoldingAtPosition(fileName: string, position: number): TextInsertion {
|
||||
throw new Error("Not Implemented Yet.");
|
||||
}
|
||||
|
||||
|
||||
@ -269,10 +269,10 @@ module FourSlashInterface {
|
||||
}
|
||||
|
||||
/**
|
||||
Compiles the current file and evaluates 'expr' in a context containing
|
||||
the emitted output, then compares (using ===) the result of that expression
|
||||
to 'value'. Do not use this function with external modules as it is not supported.
|
||||
*/
|
||||
* Compiles the current file and evaluates 'expr' in a context containing
|
||||
* the emitted output, then compares (using ===) the result of that expression
|
||||
* to 'value'. Do not use this function with external modules as it is not supported.
|
||||
*/
|
||||
public eval(expr: string, value: any) {
|
||||
FourSlash.currentTestState.verifyEval(expr, value);
|
||||
}
|
||||
@ -365,6 +365,11 @@ module FourSlashInterface {
|
||||
FourSlash.currentTestState.setVerifyDocComments(val);
|
||||
}
|
||||
|
||||
// Will fix in fourslash-referencing
|
||||
public DocCommentScaffolding(position: number, expected: ts.TextInsertion) {
|
||||
FourSlash.currentTestState.verifyDocCommentScaffolding(position, expected);
|
||||
}
|
||||
|
||||
public getScriptLexicalStructureListCount(count: number) {
|
||||
FourSlash.currentTestState.verifyGetScriptLexicalStructureListCount(count);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user