comparison UnitTestsSources/UnitTestsMain.cpp @ 3259:6f9398eb902d

unit test Toolbox.SubstituteVariables
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 18 Feb 2019 20:42:21 +0100
parents 45e1631febbb
children b32b7c44a223
comparison
equal deleted inserted replaced
3258:6f652c7bfc85 3259:6f9398eb902d
1233 SystemToolbox::GetEnvironmentVariables(env); 1233 SystemToolbox::GetEnvironmentVariables(env);
1234 ASSERT_TRUE(env.find("NOPE") == env.end()); 1234 ASSERT_TRUE(env.find("NOPE") == env.end());
1235 1235
1236 // The "PATH" environment variable should always be available on 1236 // The "PATH" environment variable should always be available on
1237 // machines running the unit tests 1237 // machines running the unit tests
1238 ASSERT_TRUE(env.find("PATH") != env.end()); 1238 ASSERT_TRUE(env.find("PATH") != env.end() /* Case used by UNIX */ ||
1239 1239 env.find("Path") != env.end() /* Case used by Windows */);
1240 ASSERT_EQ("A" + env["PATH"] + "B", 1240
1241 env["PATH"] = "hello";
1242 ASSERT_EQ("AhelloB",
1241 Toolbox::SubstituteVariables("A${PATH}B", env)); 1243 Toolbox::SubstituteVariables("A${PATH}B", env));
1242 } 1244 }
1243 1245
1244 1246
1245 TEST(MetricsRegistry, Basic) 1247 TEST(MetricsRegistry, Basic)