Simplified Tests

This commit is contained in:
Arthur Ozga 2015-07-24 15:28:28 -07:00
parent e6809c30f1
commit 45ddfa7c75
8 changed files with 50 additions and 45 deletions

View File

@ -3,4 +3,5 @@
// @Filename: emptyFile.ts
/////*0*/
verify.DocCommentScaffolding("/** */", 3);
goTo.marker("0");
verify.noDocCommentScaffolding();

View File

@ -1,11 +1,17 @@
/// <reference path='fourslash.ts' />
// @Filename: emptyFile.ts
// @Filename: functionWithParams.ts
/////*0*/
//// /*1*/
//// function foo(x: number, y: string): boolean {}
const noIndentEmptyScaffolding = "/**\n * \n * @param x \n * @param y\n */";
const oneIndentEmptyScaffolding = "/**\n * \n * @param x \n * @param y\n */";
const noIndentScaffolding = "/**\n * \n * @param x\n * @param y\n */";
const oneIndentScaffolding = "/**\n * \n * @param x\n * @param y\n */";
const noIndentOffset = 7;
const oneIndentOffset = noIndentOffset + 4;
const oneIndentOffset = noIndentOffset + 4;
goTo.marker("0");
verify.DocCommentScaffolding(noIndentScaffolding, noIndentOffset);
goTo.marker("1");
verify.DocCommentScaffolding(oneIndentScaffolding, oneIndentOffset);

View File

@ -1,6 +1,7 @@
/// <reference path='fourslash.ts' />
// @Filename: emptyFile.ts
// @Filename: justAComment.ts
//// /* /*0*/ */
goTo.marker("0");
verify.DocCommentScaffolding("/**", 3);
verify.noDocCommentScaffolding();

View File

@ -1,22 +1,14 @@
/// <reference path='fourslash.ts' />
// @Filename: emptyFile.ts
// @Filename: justAComment.ts
//// // We want to check off-by-one errors in assessing the end of the comment, so we check twice,
//// // first with a trailing space and then without.
//// // /*0*/
//// // /*1*/
/////*2*/
//// // We also want to check EOF handling at the end of a comment
//// // /*3*/
//// // /*2*/
goTo.marker("0");
verify.DocCommentScaffolding("/**", 3);
goTo.marker("1");
verify.DocCommentScaffolding("/**", 3);
goTo.marker("2");
verify.DocCommentScaffolding("/** */", 3);
goTo.marker("3");
verify.DocCommentScaffolding("/**", 3);
test.markers().forEach((marker) => {
goTo.position(marker.position);
verify.noDocCommentScaffolding();
});

View File

@ -1,9 +1,9 @@
/// <reference path='fourslash.ts' />
// @Filename: emptyFile.ts
// @Filename: indents.ts
/////*0*/
//// /*1*/
//// /*2*/function /*3*/foo/*4*/(/*5*/) /*6*/{ /*7*/}/*8*/
//// /*2*/function foo() { }
const noIndentEmptyScaffolding = "/**\n * \n */";
const oneIndentEmptyScaffolding = "/**\n * \n */";

View File

@ -1,25 +1,9 @@
/// <reference path='fourslash.ts' />
// @Filename: emptyFile.ts
////function /*0*/foo/*1*/(/*2*/) /*3*/{ /*4*/}/*5*/
// @Filename: functionDecl.ts
////function /*0*/foo/*1*/(/*2*/) /*3*/{ /*4*/}
const emptyCompletion = "/** */";
const emptyIndent = 3;
goTo.marker("0");
verify.DocCommentScaffolding(emptyCompletion, emptyIndent);
goTo.marker("1");
verify.DocCommentScaffolding(emptyCompletion, emptyIndent);
goTo.marker("2");
verify.DocCommentScaffolding(emptyCompletion, emptyIndent);
goTo.marker("3");
verify.DocCommentScaffolding(emptyCompletion, emptyIndent);
goTo.marker("4");
verify.DocCommentScaffolding(emptyCompletion, emptyIndent);
goTo.marker("5");
verify.DocCommentScaffolding(emptyCompletion, emptyIndent);
test.markers().forEach((marker) => {
goTo.position(marker.position);
verify.noDocCommentScaffolding();
});

View File

@ -0,0 +1,9 @@
/// <reference path='fourslash.ts' />
// @Filename: regex.ts
////var regex = /*0*///*1*/asdf/*2*/ /*3*///*4*/;
test.markers().forEach((marker) => {
goTo.position(marker.position);
verify.noDocCommentScaffolding();
});

View File

@ -382,6 +382,18 @@ module FourSlashInterface {
public DocCommentScaffolding(expectedText: string, expectedOffset: number) {
FourSlash.currentTestState.verifyDocCommentScaffolding({ newText: expectedText, cursorOffset: expectedOffset });
}
public noDocCommentScaffolding() {
const expectedText = "";
const expectedOffset = 0;
this.DocCommentScaffolding(expectedText, expectedOffset);
}
public emptyTemplateDocCommentScaffolding() {
const expectedText = "/** */";
const expectedOffset = 3;
this.DocCommentScaffolding(expectedText, expectedOffset);
}
public getScriptLexicalStructureListCount(count: number) {
FourSlash.currentTestState.verifyGetScriptLexicalStructureListCount(count);