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 {
188188 )
189189 }
190190
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
192199 @Test
193200 func datagramSocketReceivesChunk_WhenAvailable( ) async throws {
194201 let ( s1, s2, addr) = try await AsyncSocket . makeDatagramPair ( )
@@ -208,7 +215,9 @@ struct AsyncSocketTests {
208215 try s2. close ( )
209216 try ? Socket . unlink ( addr)
210217 }
218+ #endif
211219
220+ #if !canImport(WinSDK)
212221 #if canImport(Darwin)
213222 @Test
214223 func messageSequence_sendsMessage_receivesTuple( ) async throws {
Original file line number Diff line number Diff line change @@ -199,9 +199,17 @@ struct SocketTests {
199199 #expect( try socket. getValue ( for: . localAddressReuse) == false )
200200 }
201201
202- #if ! canImport(WinSDK)
202+ #if canImport(WinSDK)
203203 // Windows only supports setting O_NONBLOCK, and currently can't retrieve whether it's been set :)
204204 @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
205213 func socket_Sets_And_Gets_Flags( ) throws {
206214 let socket = try Socket ( domain: AF_UNIX, type: . stream)
207215 #expect( try socket. flags. contains ( . append) == false )
You can’t perform that action at this time.
0 commit comments