From 5648d5ed96d6150f14530f14df5842dc248bf4be Mon Sep 17 00:00:00 2001 From: EternalPhane Date: Sat, 16 Nov 2019 11:11:08 +0800 Subject: add unit test --- src/test/CppTests/Config.test.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/test/CppTests/Config.test.ts b/src/test/CppTests/Config.test.ts index b218de9..bfccf89 100644 --- a/src/test/CppTests/Config.test.ts +++ b/src/test/CppTests/Config.test.ts @@ -189,4 +189,26 @@ suite("C++ - Configuration Tests", () => { assert.equal("/**\n * @brief Short desc\n * \n * @tparam T I'm a template\n * @param bar Parameters everywhere\n * @param foobar Parameters everywhere\n */", result); }); + test("Multiline template", () => { + testSetup.cfg.C.commentPrefix = "/// "; + testSetup.cfg.C.firstLine = ""; + testSetup.cfg.C.lastLine = ""; + testSetup.cfg.Generic.briefTemplate = "\n{text}\n"; + testSetup.cfg.Generic.paramTemplate = "\n"; + testSetup.cfg.Generic.returnTemplate = "\n"; + const result = testSetup.SetLine(" int foo(bool a);").GetResult(); + // tslint:disable:no-trailing-whitespace + assert.equal( + result, `/// + /// + /// + /// + /// + /// + /// + /// `, + ); + // tslint:enable:no-trailing-whitespace + }); + }); -- cgit v1.2.3