From 8b29e605b76bf0f79685be511e60ff0d64a2375d Mon Sep 17 00:00:00 2001 From: to-s Date: Sat, 10 Oct 2020 14:53:58 -0400 Subject: Added file description in first line (#183) * Added file description in first line Due to https://github.com/cschlosser/doxdocgen/issues/141 * Added addIndent flag to SetLines() Co-authored-by: Christoph Schlosser <2466365+cschlosser@users.noreply.github.com> --- src/test/CppTests/TestSetup.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/test/CppTests/TestSetup.ts') diff --git a/src/test/CppTests/TestSetup.ts b/src/test/CppTests/TestSetup.ts index 2e6c7f1..ad733dd 100644 --- a/src/test/CppTests/TestSetup.ts +++ b/src/test/CppTests/TestSetup.ts @@ -26,17 +26,22 @@ export default class TestSetup { return this.SetLines([method]); } - public SetLines(lines: string[]): TestSetup { + public SetLines(lines: string[], addIndent = true): TestSetup { let mockLines: MockLine[]; // Add two empty lines with just the indentation // since one is for the triggersequence line. // And the other is if the next empty line. if (lines.length > 0) { - const indent: string = lines[0].match("^\\s*")[0]; + if (addIndent === true) { + const indent: string = lines[0].match("^\\s*")[0]; - mockLines = [indent, indent].concat(lines) - .map((l) => new MockLine(l)); + mockLines = [indent, indent].concat(lines) + .map((l) => new MockLine(l)); + } else { + mockLines = lines + .map((l) => new MockLine(l)); + } } const selection: MockSelection = new MockSelection(new MockPosition(this.firstLine, 0)); -- cgit v1.2.3