TypeScript/tests/cases/fourslash/docCommentTemplateClassDecl01.ts
Daniel Rosenwasser 7f4f461a84 Amended tests.
2015-09-24 16:30:40 -07:00

37 lines
930 B
TypeScript

/// <reference path='fourslash.ts' />
const CRLF = "\r\n";
/**
* @returns the given value with '\n' normalized to '\r\n' and with no leading newline
*/
function useCRLFAndStripLeadingNewline(str: string): string {
str = str.replace(/\r?\n/g, CRLF);
if (str.indexOf(CRLF) === 0) {
str = str.slice(CRLF.length);
}
return str;
}
function confirmNormalizedJsDoc(markerName: string, newTextOffset: number, template: string): void {
goTo.marker(markerName);
const normalized = useCRLFAndStripLeadingNewline(template);
verify.DocCommentTemplate(normalized, newTextOffset);
}
/////*decl*/class C {
//// private p;
//// constructor(a, b, c, d);
//// constructor(public a, private b, protected c, d, e?) {
//// }
////
//// foo();
//// foo(a?, b?, ...args) {
//// }
////}
confirmNormalizedJsDoc("decl", /*newTextOffset*/ 8, `
/**
*
*/
`);