We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 28a275d commit 762a89eCopy full SHA for 762a89e
Tests/TestingTests/AttachmentTests.swift
@@ -100,7 +100,13 @@ struct AttachmentTests {
100
101
#if os(Windows)
102
static let maximumNameCount = Int(_MAX_FNAME)
103
- static let reservedNames = ["COM9", "LPT9"]
+ static let reservedNames: [String] = {
104
+ // Return the list of COM ports that are NOT configured (and so will fail
105
+ // to open for writing.)
106
+ (0...9).lazy
107
+ .flatMap { ["COM\($0)", "LPT\($0)"] }
108
+ .filter { !PathFileExistsA($0) }
109
+ }()
110
#else
111
static let maximumNameCount = Int(NAME_MAX)
112
static let reservedNames: [String] = []
0 commit comments