File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,14 @@ struct AsyncSocketTests {
188
188
)
189
189
}
190
190
191
- #if !canImport(WinSDK)
191
+ #if canImport(WinSDK)
192
+ @Test
193
+ func datagramPairCreation_Throws( ) async throws {
194
+ await #expect( throws: SocketError . self) {
195
+ _ = try await AsyncSocket . makeDatagramPair ( )
196
+ }
197
+ }
198
+ #else
192
199
@Test
193
200
func datagramSocketReceivesChunk_WhenAvailable( ) async throws {
194
201
let ( s1, s2, addr) = try await AsyncSocket . makeDatagramPair ( )
@@ -208,7 +215,9 @@ struct AsyncSocketTests {
208
215
try s2. close ( )
209
216
try ? Socket . unlink ( addr)
210
217
}
218
+ #endif
211
219
220
+ #if !canImport(WinSDK)
212
221
#if canImport(Darwin)
213
222
@Test
214
223
func messageSequence_sendsMessage_receivesTuple( ) async throws {
Original file line number Diff line number Diff line change @@ -199,9 +199,17 @@ struct SocketTests {
199
199
#expect( try socket. getValue ( for: . localAddressReuse) == false )
200
200
}
201
201
202
- #if ! canImport(WinSDK)
202
+ #if canImport(WinSDK)
203
203
// Windows only supports setting O_NONBLOCK, and currently can't retrieve whether it's been set :)
204
204
@Test
205
+ func socket_Throws_On_Get_Flags( ) throws {
206
+ let socket = try Socket ( domain: AF_UNIX, type: . stream)
207
+
208
+ try socket. setFlags ( . append) // this is "OK", but actually won't set the flag
209
+ #expect( throws: SocketError . self) { try socket. flags. contains ( . append) }
210
+ }
211
+ #else
212
+ @Test
205
213
func socket_Sets_And_Gets_Flags( ) throws {
206
214
let socket = try Socket ( domain: AF_UNIX, type: . stream)
207
215
#expect( try socket. flags. contains ( . append) == false )
You can’t perform that action at this time.
0 commit comments