Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions Tests/FoundationEssentialsTests/FileManager/FileManagerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -821,20 +821,13 @@ final class FileManagerTests : XCTestCase {
#if canImport(Darwin) || os(Windows)
throw XCTSkip("This test is not applicable on this platform")
#else
if let key = ProcessInfo.processInfo.environment.keys.first(where: { $0.starts(with: "XDG") }) {
throw XCTSkip("Skipping due to presence of '\(key)' environment variable which may affect this test")
}

try FileManagerPlayground {
Directory("TestPath") {}
}.test { fileManager in
#if os(Windows)
func setenv(_ key: String, _ value: String) -> Int32 {
assert(overwrite == 1)
guard !key.contains("=") else {
errno = EINVAL
return -1
}
return _putenv("\(key)=\(value)")
}
#endif

func validate(_ key: String, suffix: String? = nil, directory: FileManager.SearchPathDirectory, domain: FileManager.SearchPathDomainMask, file: StaticString = #filePath, line: UInt = #line) {
let oldValue = ProcessInfo.processInfo.environment[key] ?? ""
var knownPath = fileManager.currentDirectoryPath.appendingPathComponent("TestPath")
Expand Down