Skip to content

Commit 7669801

Browse files
committed
Update EnBasicsTests.EnvironmentTests.test_current to support Windows
1 parent 9df2963 commit 7669801

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Tests/BasicsTests/Environment/EnvironmentTests.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,16 @@ final class EnvironmentTests: XCTestCase {
103103
/// Important: This test is inherently race-prone, if it is proven to be
104104
/// flaky, it should run in a singled threaded environment/removed entirely.
105105
func test_current() throws {
106-
try skipOnWindowsAsTestCurrentlyFails(because: "ProcessInfo.processInfo.environment[\"PATH\"] return nil")
106+
#if os(Windows)
107+
let pathEnvVarName = "Path"
108+
#else
109+
let pathEnvVarName = "PATH"
110+
#endif
111+
107112

108113
XCTAssertEqual(
109114
Environment.current["PATH"],
110-
ProcessInfo.processInfo.environment["PATH"]
115+
ProcessInfo.processInfo.environment[pathEnvVarName]
111116
)
112117
}
113118

0 commit comments

Comments
 (0)