Skip to content

Commit bea2cf8

Browse files
committed
Avoid using NAME_MAX in unit tests since it is not available on Windows.
1 parent 32d4af0 commit bea2cf8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Tests/TSCBasicTests/FileSystemTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -768,10 +768,10 @@ class FileSystemTests: XCTestCase {
768768

769769
try _testFileSystemFileLock(fileSystem: localFileSystem, fileA: fileA, fileB: fileB, lockFile: lockFile)
770770

771-
// Test some long and edge case paths. We arrange to split between the C and the Cedilla if NAME_MAX is 255.
772-
let longEdgeCase1 = tempDir.appending(component: String(repeating: "Façade! ", count: Int(NAME_MAX)).decomposedStringWithCanonicalMapping)
771+
// Test some long and edge case paths. We arrange to split between the C and the Cedilla by repeating 255 times.
772+
let longEdgeCase1 = tempDir.appending(component: String(repeating: "Façade! ", count: 255).decomposedStringWithCanonicalMapping)
773773
try localFileSystem.withLock(on: longEdgeCase1, type: .exclusive, {})
774-
let longEdgeCase2 = tempDir.appending(component: String(repeating: "🏁", count: Int(NAME_MAX)).decomposedStringWithCanonicalMapping)
774+
let longEdgeCase2 = tempDir.appending(component: String(repeating: "🏁", count: 255).decomposedStringWithCanonicalMapping)
775775
try localFileSystem.withLock(on: longEdgeCase2, type: .exclusive, {})
776776
}
777777
}

0 commit comments

Comments
 (0)