Look for the PATH environment variable rather than USER
authorChristopher Dykes <cdykes@fb.com>
Tue, 9 Aug 2016 23:24:21 +0000 (16:24 -0700)
committerFacebook Github Bot 1 <facebook-github-bot-1-bot@fb.com>
Tue, 9 Aug 2016 23:38:28 +0000 (16:38 -0700)
Summary: Windows is weird and calls it USERNAME instead, so just use one that everything agrees on: PATH

Reviewed By: yfeldblum

Differential Revision: D3691072

fbshipit-source-id: 579c6484736ef47e130049c29bef8b59c66a4482

folly/experimental/test/TestUtilTest.cpp

index c61d4432f1aff01fa5c977c447a0b4b12123b6fa..65af5ea8630072e18069c8a4b5ebaf1264772e06 100644 (file)
@@ -204,7 +204,7 @@ TEST_F(EnvVarSaverTest, ExampleNew) {
 }
 
 TEST_F(EnvVarSaverTest, ExampleExisting) {
-  auto key = "USER";
+  auto key = "PATH";
   EXPECT_NE(nullptr, getenv(key));
   auto value = std::string{getenv(key)};
 
@@ -216,7 +216,7 @@ TEST_F(EnvVarSaverTest, ExampleExisting) {
 }
 
 TEST_F(EnvVarSaverTest, ExampleDeleting) {
-  auto key = "USER";
+  auto key = "PATH";
   EXPECT_NE(nullptr, getenv(key));
   auto value = std::string{getenv(key)};