summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorChristoph Schlosser <2466365+cschlosser@users.noreply.github.com>2020-10-04 13:38:20 +0200
committerGitHub <noreply@github.com>2020-10-04 13:38:20 +0200
commit175bd0d5bb123a99f7de91d6045a0a25f670dd65 (patch)
treeb9bdf29f7a9af9b9d1cfceb55d1ace265176bc9e /src/test
parent6a541f4882e62bd37c37bb20962414d5e31d79a4 (diff)
downloaddoxdocgen-175bd0d5bb123a99f7de91d6045a0a25f670dd65.tar.gz
Release 1.0.0 (#180)1.0.0
* Reenable: Add env-var to replace env var in template strings (#175) * Release 1.0.0 * Add ls output to travis package step to see size of vsix
Diffstat (limited to 'src/test')
-rw-r--r--src/test/CppTests/Config.test.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/CppTests/Config.test.ts b/src/test/CppTests/Config.test.ts
index 3915f11..d479d2d 100644
--- a/src/test/CppTests/Config.test.ts
+++ b/src/test/CppTests/Config.test.ts
@@ -227,4 +227,24 @@ suite("C++ - Configuration Tests", () => {
assert.equal("/**\n * @note\n */", result);
});
+ test("Env variable", () => {
+ testSetup.cfg = new Config();
+ testSetup.cfg.Generic.order = ["custom"];
+ if (process.platform === "win32") {
+ testSetup.cfg.Generic.customTags = ["@author ${env:USERNAME}"];
+ const res = testSetup.SetLine("void foo();").GetResult();
+ // USERNAME env var is different for everybody
+ assert.notEqual("/**\n * @author USERNAME\n */", res);
+ } else {
+ testSetup.cfg.Generic.customTags = ["@author ${env:USER}"];
+ const res = testSetup.SetLine("void foo();").GetResult();
+ // USER env var is different for everybody
+ assert.notEqual("/**\n * @author USER\n */", res);
+ }
+
+ testSetup.cfg.Generic.customTags = ["@author ${env:MY_VARIABLE}"];
+ const result = testSetup.SetLine("void foo();").GetResult();
+ assert.equal("/**\n * @author MY_VARIABLE\n */", result);
+ });
+
});