mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Amended tests.
This commit is contained in:
@@ -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, `
|
||||
/**
|
||||
*
|
||||
*/`);
|
||||
*/
|
||||
`);
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
`);
|
||||
|
||||
@@ -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
|
||||
*/`);
|
||||
|
||||
@@ -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, `
|
||||
/**
|
||||
*
|
||||
*/`);
|
||||
|
||||
@@ -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, `
|
||||
/**
|
||||
*
|
||||
*/`);
|
||||
|
||||
@@ -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, `
|
||||
/**
|
||||
*
|
||||
*/`);
|
||||
|
||||
Reference in New Issue
Block a user