From 7f4f461a84b7bf71503d14e57e6b1936acb7d406 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 24 Sep 2015 16:30:40 -0700 Subject: [PATCH] Amended tests. --- .../docCommentTemplateClassDecl01.ts | 9 +-- .../docCommentTemplateClassDeclMethods01.ts | 59 ++++++++++--------- .../docCommentTemplateConstructor01.ts | 38 ++++++------ .../docCommentTemplateNamespaces01.ts | 10 ++-- .../docCommentTemplateVariableStatements01.ts | 6 +- .../docCommentTemplateVariableStatements02.ts | 6 +- 6 files changed, 67 insertions(+), 61 deletions(-) diff --git a/tests/cases/fourslash/docCommentTemplateClassDecl01.ts b/tests/cases/fourslash/docCommentTemplateClassDecl01.ts index c7c858cd262..958a8c60fa4 100644 --- a/tests/cases/fourslash/docCommentTemplateClassDecl01.ts +++ b/tests/cases/fourslash/docCommentTemplateClassDecl01.ts @@ -12,10 +12,10 @@ function useCRLFAndStripLeadingNewline(str: string): string { return str; } -function confirmNormalizedJsDoc(markerName: string, indentation: number, template: string): void { +function confirmNormalizedJsDoc(markerName: string, newTextOffset: number, template: string): void { goTo.marker(markerName); const normalized = useCRLFAndStripLeadingNewline(template); - verify.DocCommentTemplate(normalized, indentation); + verify.DocCommentTemplate(normalized, newTextOffset); } /////*decl*/class C { @@ -29,7 +29,8 @@ function confirmNormalizedJsDoc(markerName: string, indentation: number, templat //// } ////} -confirmNormalizedJsDoc("decl", /*indentation*/ 0, ` +confirmNormalizedJsDoc("decl", /*newTextOffset*/ 8, ` /** * - */`); + */ +`); diff --git a/tests/cases/fourslash/docCommentTemplateClassDeclMethods01.ts b/tests/cases/fourslash/docCommentTemplateClassDeclMethods01.ts index bb14d89e3bf..72f9ce10809 100644 --- a/tests/cases/fourslash/docCommentTemplateClassDeclMethods01.ts +++ b/tests/cases/fourslash/docCommentTemplateClassDeclMethods01.ts @@ -19,8 +19,8 @@ function confirmNormalizedJsDoc(markerName: string, indentation: number, templat } const enum Indentation { - Gutter = 0, - Proper = 4, + Standard = 8, + Indented = 12, } @@ -34,36 +34,39 @@ const enum Indentation { //// } ////} -confirmNormalizedJsDoc("0", Indentation.Gutter, ` +confirmNormalizedJsDoc("0", Indentation.Standard, ` /** * */`); -confirmNormalizedJsDoc("2", Indentation.Proper, ` -/** - * - * @param a - */`); +confirmNormalizedJsDoc("2", Indentation.Indented, + `/** + * + * @param a + */ + `); -confirmNormalizedJsDoc("3", Indentation.Proper, ` -/** - * - * @param a - * @param b - */`); +confirmNormalizedJsDoc("3", Indentation.Indented, + `/** + * + * @param a + * @param b + */ + `); -confirmNormalizedJsDoc("4", Indentation.Proper, ` -/** - * - * @param a - * @param param1 - * @param b - */`); +confirmNormalizedJsDoc("4", Indentation.Indented, + `/** + * + * @param a + * @param param1 + * @param c + */`); -confirmNormalizedJsDoc("5", Indentation.Proper, ` -/** - * - * @param a - * @param b - * @param args - */`); +confirmNormalizedJsDoc("5", Indentation.Indented, + `/** + * + * @param a + * @param b + * @param args + */ + `); diff --git a/tests/cases/fourslash/docCommentTemplateConstructor01.ts b/tests/cases/fourslash/docCommentTemplateConstructor01.ts index c44d8fc22bd..b26ece7a5e6 100644 --- a/tests/cases/fourslash/docCommentTemplateConstructor01.ts +++ b/tests/cases/fourslash/docCommentTemplateConstructor01.ts @@ -12,10 +12,10 @@ function useCRLFAndStripLeadingNewline(str: string): string { return str; } -function confirmNormalizedJsDoc(markerName: string, indentation: number, template: string): void { +function confirmNormalizedJsDoc(markerName: string, newTextOffset: number, template: string): void { goTo.marker(markerName); const normalized = useCRLFAndStripLeadingNewline(template); - verify.DocCommentTemplate(normalized, indentation); + verify.DocCommentTemplate(normalized, newTextOffset); } ////class C { @@ -31,20 +31,22 @@ function confirmNormalizedJsDoc(markerName: string, indentation: number, templat //// } ////} -confirmNormalizedJsDoc("0", /*indentation*/ 4, ` -/** - * - * @param a - * @param b - * @param c - * @param d - */`); +const newTextOffset = 12; +confirmNormalizedJsDoc("0", /*newTextOffset*/ newTextOffset, + `/** + * + * @param a + * @param b + * @param c + * @param d + */`); -confirmNormalizedJsDoc("1", /*indentation*/ 4, ` -/** - * - * @param a - * @param b - * @param c - * @param d - */`); +confirmNormalizedJsDoc("1", /*newTextOffset*/ newTextOffset, + `/** + * + * @param a + * @param b + * @param c + * @param d + * @param e + */`); diff --git a/tests/cases/fourslash/docCommentTemplateNamespaces01.ts b/tests/cases/fourslash/docCommentTemplateNamespaces01.ts index 6c10d5f5395..4d9fb987be5 100644 --- a/tests/cases/fourslash/docCommentTemplateNamespaces01.ts +++ b/tests/cases/fourslash/docCommentTemplateNamespaces01.ts @@ -12,10 +12,10 @@ function useCRLFAndStripLeadingNewline(str: string): string { return str; } -function confirmNormalizedJsDoc(markerName: string, indentation: number, template: string): void { +function confirmNormalizedJsDoc(markerName: string, charOffset: number, template: string): void { goTo.marker(markerName); const normalized = useCRLFAndStripLeadingNewline(template); - verify.DocCommentTemplate(normalized, indentation); + verify.DocCommentTemplate(normalized, charOffset); } /////*namespaceN*/ @@ -30,17 +30,17 @@ function confirmNormalizedJsDoc(markerName: string, indentation: number, templat ////module "ambientModule" { ////} -confirmNormalizedJsDoc("namespaceN", /*indentation*/ 4, ` +confirmNormalizedJsDoc("namespaceN", /*indentation*/ 8, ` /** * */`); -confirmNormalizedJsDoc("namespaceM", /*indentation*/ 4, ` +confirmNormalizedJsDoc("namespaceM", /*indentation*/ 8, ` /** * */`); -confirmNormalizedJsDoc("namespaceM", /*indentation*/ 4, ` +confirmNormalizedJsDoc("namespaceM", /*indentation*/ 8, ` /** * */`); diff --git a/tests/cases/fourslash/docCommentTemplateVariableStatements01.ts b/tests/cases/fourslash/docCommentTemplateVariableStatements01.ts index 11ea2b52967..6859d9aa1ec 100644 --- a/tests/cases/fourslash/docCommentTemplateVariableStatements01.ts +++ b/tests/cases/fourslash/docCommentTemplateVariableStatements01.ts @@ -12,10 +12,10 @@ function useCRLFAndStripLeadingNewline(str: string): string { return str; } -function confirmNormalizedJsDoc(markerName: string, indentation: number, template: string): void { +function confirmNormalizedJsDoc(markerName: string, newTextOffset: number, template: string): void { goTo.marker(markerName); const normalized = useCRLFAndStripLeadingNewline(template); - verify.DocCommentTemplate(normalized, indentation); + verify.DocCommentTemplate(normalized, newTextOffset); } /////*a*/ @@ -47,7 +47,7 @@ function confirmNormalizedJsDoc(markerName: string, indentation: number, templat ////}; for (const varName of "abcdef".split("")) { - confirmNormalizedJsDoc(varName, /*indentation*/ 0, ` + confirmNormalizedJsDoc(varName, /*newTextOffset*/ 8, ` /** * */`); diff --git a/tests/cases/fourslash/docCommentTemplateVariableStatements02.ts b/tests/cases/fourslash/docCommentTemplateVariableStatements02.ts index 7ff2115c7d6..9339e703570 100644 --- a/tests/cases/fourslash/docCommentTemplateVariableStatements02.ts +++ b/tests/cases/fourslash/docCommentTemplateVariableStatements02.ts @@ -12,10 +12,10 @@ function useCRLFAndStripLeadingNewline(str: string): string { return str; } -function confirmNormalizedJsDoc(markerName: string, indentation: number, template: string): void { +function confirmNormalizedJsDoc(markerName: string, newTextOffset: number, template: string): void { goTo.marker(markerName); const normalized = useCRLFAndStripLeadingNewline(template); - verify.DocCommentTemplate(normalized, indentation); + verify.DocCommentTemplate(normalized, newTextOffset); } /////*a*/ @@ -47,7 +47,7 @@ function confirmNormalizedJsDoc(markerName: string, indentation: number, templat ////}, f2 = null; for (const varName of "abcdef".split("")) { - confirmNormalizedJsDoc(varName, /*indentation*/ 0, ` + confirmNormalizedJsDoc(varName, /*newTextOffset*/ 8, ` /** * */`);