From b9e681a0b1f2969bce02de8b19be8b589967ff81 Mon Sep 17 00:00:00 2001 From: Christoph Schlosser Date: Sun, 25 Feb 2018 00:16:04 +0100 Subject: Add tests --- src/test/CppTests/Config.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/test/CppTests/Config.test.ts') diff --git a/src/test/CppTests/Config.test.ts b/src/test/CppTests/Config.test.ts index 0459dcb..bb16c20 100644 --- a/src/test/CppTests/Config.test.ts +++ b/src/test/CppTests/Config.test.ts @@ -8,6 +8,7 @@ import * as assert from "assert"; // You can import and use all API from the 'vscode' module // as well as import your extension to test it +import * as moment from "moment"; import * as vscode from "vscode"; import { Config } from "../../Config"; import TestSetup from "./TestSetup"; @@ -92,4 +93,13 @@ suite("C++ - Configuration Tests", () => { const negativeResult = testSetup.SetLines(["template bool \n", "foo(T a);"]).GetResult(); assert.equal("/**\n * @brief \n * \n */", negativeResult); }); + + test("File description order test", () => { + testSetup.cfg = new Config(); + testSetup.firstLine = 0; + testSetup.cfg.fileOrder = ["brief", "author", "date", "file"]; + const result = testSetup.SetLine("").GetResult(); + assert.equal("/**\n * @brief \n * \n * @author your name\n" + + " * @date " + moment().format("YYYY-MM-DD") + "\n * @file MockDocument.h\n */", result); + }); }); -- cgit v1.2.3