From 175bd0d5bb123a99f7de91d6045a0a25f670dd65 Mon Sep 17 00:00:00 2001 From: Christoph Schlosser <2466365+cschlosser@users.noreply.github.com> Date: Sun, 4 Oct 2020 13:38:20 +0200 Subject: Release 1.0.0 (#180) * 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 --- src/test/CppTests/Config.test.ts | 20 ++++++++++++++++++++ 1 file changed, 20 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 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); + }); + }); -- cgit v1.2.3