feat(discovery): bonjour beacons + bridge presence

This commit is contained in:
Peter Steinberger
2025-12-13 04:28:12 +00:00
parent 3ee0e041fa
commit 1f37d94f9e
49 changed files with 1182 additions and 320 deletions

View File

@@ -7,7 +7,8 @@ import Testing
private final class FakeWebSocketTask: WebSocketTasking, @unchecked Sendable {
private let connectRequestID = OSAllocatedUnfairLock<String?>(initialState: nil)
private let pendingReceiveHandler =
OSAllocatedUnfairLock<(@Sendable (Result<URLSessionWebSocketTask.Message, Error>) -> Void)?>(initialState: nil)
OSAllocatedUnfairLock<(@Sendable (Result<URLSessionWebSocketTask.Message, Error>)
-> Void)?>(initialState: nil)
private let cancelCount = OSAllocatedUnfairLock(initialState: 0)
private let sendCount = OSAllocatedUnfairLock(initialState: 0)
private let helloDelayMs: Int

View File

@@ -8,7 +8,8 @@ import Testing
private let requestSendDelayMs: Int
private let connectRequestID = OSAllocatedUnfairLock<String?>(initialState: nil)
private let pendingReceiveHandler =
OSAllocatedUnfairLock<(@Sendable (Result<URLSessionWebSocketTask.Message, Error>) -> Void)?>(initialState: nil)
OSAllocatedUnfairLock<(@Sendable (Result<URLSessionWebSocketTask.Message, Error>)
-> Void)?>(initialState: nil)
private let sendCount = OSAllocatedUnfairLock(initialState: 0)
var state: URLSessionTask.State = .suspended

View File

@@ -7,7 +7,8 @@ import Testing
private final class FakeWebSocketTask: WebSocketTasking, @unchecked Sendable {
private let connectRequestID = OSAllocatedUnfairLock<String?>(initialState: nil)
private let pendingReceiveHandler =
OSAllocatedUnfairLock<(@Sendable (Result<URLSessionWebSocketTask.Message, Error>) -> Void)?>(initialState: nil)
OSAllocatedUnfairLock<(@Sendable (Result<URLSessionWebSocketTask.Message, Error>)
-> Void)?>(initialState: nil)
private let cancelCount = OSAllocatedUnfairLock(initialState: 0)
var state: URLSessionTask.State = .suspended

View File

@@ -9,10 +9,10 @@ import Testing
#expect(age(from: now.addingTimeInterval(-45), now: now) == "just now")
#expect(age(from: now.addingTimeInterval(-75), now: now) == "1 minute ago")
#expect(age(from: now.addingTimeInterval(-10 * 60), now: now) == "10m ago")
#expect(age(from: now.addingTimeInterval(-3_600), now: now) == "1 hour ago")
#expect(age(from: now.addingTimeInterval(-5 * 3_600), now: now) == "5h ago")
#expect(age(from: now.addingTimeInterval(-26 * 3_600), now: now) == "yesterday")
#expect(age(from: now.addingTimeInterval(-3 * 86_400), now: now) == "3d ago")
#expect(age(from: now.addingTimeInterval(-3600), now: now) == "1 hour ago")
#expect(age(from: now.addingTimeInterval(-5 * 3600), now: now) == "5h ago")
#expect(age(from: now.addingTimeInterval(-26 * 3600), now: now) == "yesterday")
#expect(age(from: now.addingTimeInterval(-3 * 86400), now: now) == "3d ago")
}
@Test func parseSSHTargetSupportsUserPortAndDefaults() {