mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 02:30:15 -06:00
Add Tests
This commit is contained in:
parent
24b29f1fb7
commit
fff2f7be22
@ -3,4 +3,4 @@
|
||||
// @Filename: emptyFile.ts
|
||||
/////*0*/
|
||||
|
||||
verify.DocCommentScaffolding(0, { newText: "/** */", cursorOffset: 3});
|
||||
verify.DocCommentScaffolding("/** */", 3);
|
||||
@ -0,0 +1,11 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @Filename: emptyFile.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 noIndentOffset = 7;
|
||||
const oneIndentOffset = noIndentOffset + 4;
|
||||
@ -0,0 +1,6 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @Filename: emptyFile.ts
|
||||
//// /* /*0*/ */
|
||||
goTo.marker("0");
|
||||
verify.DocCommentScaffolding("/**", 3);
|
||||
@ -0,0 +1,22 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @Filename: emptyFile.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*/
|
||||
|
||||
goTo.marker("0");
|
||||
verify.DocCommentScaffolding("/**", 3);
|
||||
|
||||
goTo.marker("1");
|
||||
verify.DocCommentScaffolding("/**", 3);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.DocCommentScaffolding("/** */", 3);
|
||||
|
||||
goTo.marker("3");
|
||||
verify.DocCommentScaffolding("/**", 3);
|
||||
22
tests/cases/fourslash/docCommentScaffoldingIndentation.ts
Normal file
22
tests/cases/fourslash/docCommentScaffoldingIndentation.ts
Normal file
@ -0,0 +1,22 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @Filename: emptyFile.ts
|
||||
/////*0*/
|
||||
//// /*1*/
|
||||
//// /*2*/function /*3*/foo/*4*/(/*5*/) /*6*/{ /*7*/}/*8*/
|
||||
|
||||
const noIndentEmptyScaffolding = "/**\n * \n */";
|
||||
const oneIndentEmptyScaffolding = "/**\n * \n */";
|
||||
const twoIndentEmptyScaffolding = "/**\n * \n */";
|
||||
const noIndentOffset = 7;
|
||||
const oneIndentOffset = noIndentOffset + 4;
|
||||
const twoIndentOffset = oneIndentOffset + 4;
|
||||
|
||||
goTo.marker("0");
|
||||
verify.DocCommentScaffolding(noIndentEmptyScaffolding, noIndentOffset);
|
||||
|
||||
goTo.marker("1");
|
||||
verify.DocCommentScaffolding(oneIndentEmptyScaffolding, oneIndentOffset);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.DocCommentScaffolding(twoIndentEmptyScaffolding, twoIndentOffset);
|
||||
@ -0,0 +1,25 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @Filename: emptyFile.ts
|
||||
////function /*0*/foo/*1*/(/*2*/) /*3*/{ /*4*/}/*5*/
|
||||
|
||||
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);
|
||||
Loading…
x
Reference in New Issue
Block a user