summaryrefslogtreecommitdiffstats
path: root/src/test/CppTests
diff options
context:
space:
mode:
authorHO-COOH <42881734+HO-COOH@users.noreply.github.com>2021-05-29 18:20:50 +0800
committerGitHub <noreply@github.com>2021-05-29 12:20:50 +0200
commitaa21a82e8b7dca30e3650d164c6fcb3bb495b17e (patch)
tree8feec05acebe434c31fad0ae44ba718e197b18d7 /src/test/CppTests
parent638cfe09c56b8e75cf3dfa77652f51312766bd36 (diff)
downloaddoxdocgen-aa21a82e8b7dca30e3650d164c6fcb3bb495b17e.tar.gz
fix indent not expanded in file comments (#236)
Diffstat (limited to 'src/test/CppTests')
-rw-r--r--src/test/CppTests/Config.test.ts28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/test/CppTests/Config.test.ts b/src/test/CppTests/Config.test.ts
index f6ec573..5c92fa6 100644
--- a/src/test/CppTests/Config.test.ts
+++ b/src/test/CppTests/Config.test.ts
@@ -93,7 +93,7 @@ suite("C++ - Configuration Tests", () => {
+ " * @return true \n * @return false \n */");
});
- test("Indentation test", () => {
+ test("Function comment indentation test", () => {
testSetup.cfg = new Config();
let result = testSetup.SetLine("\ttemplate<typename T> bool foo(T a);").GetResult();
assert.strictEqual(result, "/**\n\t * @brief \n\t * \n\t * @tparam T \n\t * @param a \n\t * "
@@ -105,6 +105,32 @@ suite("C++ - Configuration Tests", () => {
+ "@return true \n * @return false \n */");
});
+ test("File comment indentation test", () => {
+ testSetup.cfg.File.fileOrder = [
+ "file",
+ "author",
+ "brief",
+ "version",
+ "date",
+ "copyright",
+ ];
+ testSetup.cfg.File.fileTemplate = "@file{indent:10}{name}";
+ testSetup.cfg.Generic.authorTag = "@author{indent:10}{author}";
+ testSetup.cfg.Generic.briefTemplate = "@brief{indent:10}Thing";
+ testSetup.cfg.File.versionTag = "@version{indent:10}0.1";
+ testSetup.cfg.Generic.dateTemplate = "@date{indent:10}date";
+ testSetup.cfg.File.copyrightTag = ["@copyright{indent:10}Copyright(c)"];
+ const result = testSetup.SetLine("").GetResult();
+ assert.strictEqual(result, `/**
+ * @file MockDocument.h
+ * @author your name
+ * @brief Thing
+ * @version 0.1
+ * @date date
+ * @copyrightCopyright(c)
+ */`);
+ });
+
test("Lines to get test", () => {
testSetup.cfg = new Config();
testSetup.cfg.Generic.linesToGet = 2;