Skip to content

Commit 7f4f461

Browse files
Amended tests.
1 parent 1545ab5 commit 7f4f461

6 files changed

+67
-61
lines changed

tests/cases/fourslash/docCommentTemplateClassDecl01.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ function useCRLFAndStripLeadingNewline(str: string): string {
1212
return str;
1313
}
1414

15-
function confirmNormalizedJsDoc(markerName: string, indentation: number, template: string): void {
15+
function confirmNormalizedJsDoc(markerName: string, newTextOffset: number, template: string): void {
1616
goTo.marker(markerName);
1717
const normalized = useCRLFAndStripLeadingNewline(template);
18-
verify.DocCommentTemplate(normalized, indentation);
18+
verify.DocCommentTemplate(normalized, newTextOffset);
1919
}
2020

2121
/////*decl*/class C {
@@ -29,7 +29,8 @@ function confirmNormalizedJsDoc(markerName: string, indentation: number, templat
2929
//// }
3030
////}
3131

32-
confirmNormalizedJsDoc("decl", /*indentation*/ 0, `
32+
confirmNormalizedJsDoc("decl", /*newTextOffset*/ 8, `
3333
/**
3434
*
35-
*/`);
35+
*/
36+
`);

tests/cases/fourslash/docCommentTemplateClassDeclMethods01.ts

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ function confirmNormalizedJsDoc(markerName: string, indentation: number, templat
1919
}
2020

2121
const enum Indentation {
22-
Gutter = 0,
23-
Proper = 4,
22+
Standard = 8,
23+
Indented = 12,
2424
}
2525

2626

@@ -34,36 +34,39 @@ const enum Indentation {
3434
//// }
3535
////}
3636

37-
confirmNormalizedJsDoc("0", Indentation.Gutter, `
37+
confirmNormalizedJsDoc("0", Indentation.Standard, `
3838
/**
3939
*
4040
*/`);
4141

42-
confirmNormalizedJsDoc("2", Indentation.Proper, `
43-
/**
44-
*
45-
* @param a
46-
*/`);
42+
confirmNormalizedJsDoc("2", Indentation.Indented,
43+
`/**
44+
*
45+
* @param a
46+
*/
47+
`);
4748

48-
confirmNormalizedJsDoc("3", Indentation.Proper, `
49-
/**
50-
*
51-
* @param a
52-
* @param b
53-
*/`);
49+
confirmNormalizedJsDoc("3", Indentation.Indented,
50+
`/**
51+
*
52+
* @param a
53+
* @param b
54+
*/
55+
`);
5456

55-
confirmNormalizedJsDoc("4", Indentation.Proper, `
56-
/**
57-
*
58-
* @param a
59-
* @param param1
60-
* @param b
61-
*/`);
57+
confirmNormalizedJsDoc("4", Indentation.Indented,
58+
`/**
59+
*
60+
* @param a
61+
* @param param1
62+
* @param c
63+
*/`);
6264

63-
confirmNormalizedJsDoc("5", Indentation.Proper, `
64-
/**
65-
*
66-
* @param a
67-
* @param b
68-
* @param args
69-
*/`);
65+
confirmNormalizedJsDoc("5", Indentation.Indented,
66+
`/**
67+
*
68+
* @param a
69+
* @param b
70+
* @param args
71+
*/
72+
`);

tests/cases/fourslash/docCommentTemplateConstructor01.ts

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ function useCRLFAndStripLeadingNewline(str: string): string {
1212
return str;
1313
}
1414

15-
function confirmNormalizedJsDoc(markerName: string, indentation: number, template: string): void {
15+
function confirmNormalizedJsDoc(markerName: string, newTextOffset: number, template: string): void {
1616
goTo.marker(markerName);
1717
const normalized = useCRLFAndStripLeadingNewline(template);
18-
verify.DocCommentTemplate(normalized, indentation);
18+
verify.DocCommentTemplate(normalized, newTextOffset);
1919
}
2020

2121
////class C {
@@ -31,20 +31,22 @@ function confirmNormalizedJsDoc(markerName: string, indentation: number, templat
3131
//// }
3232
////}
3333

34-
confirmNormalizedJsDoc("0", /*indentation*/ 4, `
35-
/**
36-
*
37-
* @param a
38-
* @param b
39-
* @param c
40-
* @param d
41-
*/`);
34+
const newTextOffset = 12;
35+
confirmNormalizedJsDoc("0", /*newTextOffset*/ newTextOffset,
36+
`/**
37+
*
38+
* @param a
39+
* @param b
40+
* @param c
41+
* @param d
42+
*/`);
4243

43-
confirmNormalizedJsDoc("1", /*indentation*/ 4, `
44-
/**
45-
*
46-
* @param a
47-
* @param b
48-
* @param c
49-
* @param d
50-
*/`);
44+
confirmNormalizedJsDoc("1", /*newTextOffset*/ newTextOffset,
45+
`/**
46+
*
47+
* @param a
48+
* @param b
49+
* @param c
50+
* @param d
51+
* @param e
52+
*/`);

tests/cases/fourslash/docCommentTemplateNamespaces01.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ function useCRLFAndStripLeadingNewline(str: string): string {
1212
return str;
1313
}
1414

15-
function confirmNormalizedJsDoc(markerName: string, indentation: number, template: string): void {
15+
function confirmNormalizedJsDoc(markerName: string, charOffset: number, template: string): void {
1616
goTo.marker(markerName);
1717
const normalized = useCRLFAndStripLeadingNewline(template);
18-
verify.DocCommentTemplate(normalized, indentation);
18+
verify.DocCommentTemplate(normalized, charOffset);
1919
}
2020

2121
/////*namespaceN*/
@@ -30,17 +30,17 @@ function confirmNormalizedJsDoc(markerName: string, indentation: number, templat
3030
////module "ambientModule" {
3131
////}
3232

33-
confirmNormalizedJsDoc("namespaceN", /*indentation*/ 4, `
33+
confirmNormalizedJsDoc("namespaceN", /*indentation*/ 8, `
3434
/**
3535
*
3636
*/`);
3737

38-
confirmNormalizedJsDoc("namespaceM", /*indentation*/ 4, `
38+
confirmNormalizedJsDoc("namespaceM", /*indentation*/ 8, `
3939
/**
4040
*
4141
*/`);
4242

43-
confirmNormalizedJsDoc("namespaceM", /*indentation*/ 4, `
43+
confirmNormalizedJsDoc("namespaceM", /*indentation*/ 8, `
4444
/**
4545
*
4646
*/`);

tests/cases/fourslash/docCommentTemplateVariableStatements01.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ function useCRLFAndStripLeadingNewline(str: string): string {
1212
return str;
1313
}
1414

15-
function confirmNormalizedJsDoc(markerName: string, indentation: number, template: string): void {
15+
function confirmNormalizedJsDoc(markerName: string, newTextOffset: number, template: string): void {
1616
goTo.marker(markerName);
1717
const normalized = useCRLFAndStripLeadingNewline(template);
18-
verify.DocCommentTemplate(normalized, indentation);
18+
verify.DocCommentTemplate(normalized, newTextOffset);
1919
}
2020

2121
/////*a*/
@@ -47,7 +47,7 @@ function confirmNormalizedJsDoc(markerName: string, indentation: number, templat
4747
////};
4848

4949
for (const varName of "abcdef".split("")) {
50-
confirmNormalizedJsDoc(varName, /*indentation*/ 0, `
50+
confirmNormalizedJsDoc(varName, /*newTextOffset*/ 8, `
5151
/**
5252
*
5353
*/`);

tests/cases/fourslash/docCommentTemplateVariableStatements02.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ function useCRLFAndStripLeadingNewline(str: string): string {
1212
return str;
1313
}
1414

15-
function confirmNormalizedJsDoc(markerName: string, indentation: number, template: string): void {
15+
function confirmNormalizedJsDoc(markerName: string, newTextOffset: number, template: string): void {
1616
goTo.marker(markerName);
1717
const normalized = useCRLFAndStripLeadingNewline(template);
18-
verify.DocCommentTemplate(normalized, indentation);
18+
verify.DocCommentTemplate(normalized, newTextOffset);
1919
}
2020

2121
/////*a*/
@@ -47,7 +47,7 @@ function confirmNormalizedJsDoc(markerName: string, indentation: number, templat
4747
////}, f2 = null;
4848

4949
for (const varName of "abcdef".split("")) {
50-
confirmNormalizedJsDoc(varName, /*indentation*/ 0, `
50+
confirmNormalizedJsDoc(varName, /*newTextOffset*/ 8, `
5151
/**
5252
*
5353
*/`);

0 commit comments

Comments
 (0)