From 5b0912d99732536ae18d3c70730cc6df2ed3af24 Mon Sep 17 00:00:00 2001 From: Rowan Goemans Date: Thu, 28 Dec 2017 21:00:30 +0100 Subject: -- Implemented support for all operators except the conversion operator. -- Implemented support for noexcept and throw. -- Implemented support for constexpr. -- Implemented support for multiple template specifications. -- Rewritten some unit tests. -- Fixed bug where unnamed parameters weren't recognized properly -- Fixed bug where namespace with template params weren't being parsed correctly. --- src/test/TestSetup.ts | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/test/TestSetup.ts (limited to 'src/test/TestSetup.ts') diff --git a/src/test/TestSetup.ts b/src/test/TestSetup.ts new file mode 100644 index 0000000..2f4f64a --- /dev/null +++ b/src/test/TestSetup.ts @@ -0,0 +1,46 @@ +import * as vscode from "vscode"; +import CodeParser from "../CodeParser/CodeParser"; +import CParser from "../CodeParser/CParser/CParser"; +import { IDocGen } from "../DocGen/DocGen"; +import * as myExtension from "../extension"; +import MockDocument from "./MockDocument"; +import MockEditor from "./MockEditor"; +import MockLine from "./MockLine"; +import MockPosition from "./MockPosition"; +import MockSelection from "./MockSelection"; + +export default class TestSetup { + private editor: MockEditor; + + constructor(method: string) { + this.SetMethod(method); + } + + public SetMethod(method: string): TestSetup { + let position: MockPosition; + position = new MockPosition(0, 0); + + let selection: MockSelection; + selection = new MockSelection(position); + + let line: MockLine; + line = new MockLine(method); + + let doc: MockDocument; + doc = new MockDocument(line); + + this.editor = new MockEditor(selection, doc); + + return this; + } + + public GetResult(): string { + let parser: CodeParser; + parser = new CParser(); + + const gen: IDocGen = parser.Parse(this.editor); + gen.GenerateDoc(new vscode.Range(new vscode.Position(0, 0), new vscode.Position(0, 0))); + + return this.editor.editBuilder.text; + } +} -- cgit v1.2.3