style: swiftformat sweep

This commit is contained in:
Peter Steinberger
2026-01-08 02:36:29 +00:00
parent 7f0f82e869
commit 1e1293cc0a
44 changed files with 85 additions and 89 deletions

View File

@@ -1,5 +1,5 @@
@testable import ClawdbotChatUI
import Testing
@testable import ClawdbotChatUI
@Suite struct AssistantTextParserTests {
@Test func splitsThinkAndFinalSegments() {

View File

@@ -24,4 +24,3 @@ import Testing
#expect(BonjourEscapes.decode("Hello\\065World") == "HelloAWorld")
}
}

View File

@@ -40,4 +40,3 @@ import Testing
}
}
}

View File

@@ -13,4 +13,3 @@ import Testing
#expect(decoded.format == .jpeg)
}
}

View File

@@ -1,6 +1,6 @@
@testable import ClawdbotChatUI
import Foundation
import Testing
@testable import ClawdbotChatUI
#if os(macOS)
import AppKit

View File

@@ -1,7 +1,7 @@
@testable import ClawdbotChatUI
import ClawdbotKit
import Foundation
import Testing
@testable import ClawdbotChatUI
private struct TimeoutError: Error, CustomStringConvertible {
let label: String
@@ -118,20 +118,20 @@ private final class TestChatTransport: @unchecked Sendable, ClawdbotChatTranspor
}
}
private extension TestChatTransportState {
func setHistoryCallCount(_ v: Int) {
extension TestChatTransportState {
fileprivate func setHistoryCallCount(_ v: Int) {
self.historyCallCount = v
}
func setSessionsCallCount(_ v: Int) {
fileprivate func setSessionsCallCount(_ v: Int) {
self.sessionsCallCount = v
}
func sentRunIdsAppend(_ v: String) {
fileprivate func sentRunIdsAppend(_ v: String) {
self.sentRunIds.append(v)
}
func abortedRunIdsAppend(_ v: String) {
fileprivate func abortedRunIdsAppend(_ v: String) {
self.abortedRunIds.append(v)
}
}
@@ -177,7 +177,9 @@ private extension TestChatTransportState {
ts: Int(Date().timeIntervalSince1970 * 1000),
data: ["text": AnyCodable("streaming…")])))
try await waitUntil("assistant stream visible") { await MainActor.run { vm.streamingAssistantText == "streaming…" } }
try await waitUntil("assistant stream visible") {
await MainActor.run { vm.streamingAssistantText == "streaming…" }
}
transport.emit(
.agent(
@@ -206,7 +208,9 @@ private extension TestChatTransportState {
errorMessage: nil)))
try await waitUntil("pending run clears") { await MainActor.run { vm.pendingRunCount == 0 } }
try await waitUntil("history refresh") { await MainActor.run { vm.messages.contains(where: { $0.role == "assistant" }) } }
try await waitUntil("history refresh") {
await MainActor.run { vm.messages.contains(where: { $0.role == "assistant" }) }
}
#expect(await MainActor.run { vm.streamingAssistantText } == nil)
#expect(await MainActor.run { vm.pendingToolCalls.isEmpty })
}
@@ -247,7 +251,9 @@ private extension TestChatTransportState {
"args": AnyCodable(["x": 1]),
])))
try await waitUntil("streaming active") { await MainActor.run { vm.streamingAssistantText == "external stream" } }
try await waitUntil("streaming active") {
await MainActor.run { vm.streamingAssistantText == "external stream" }
}
try await waitUntil("tool call pending") { await MainActor.run { vm.pendingToolCalls.count == 1 } }
transport.emit(
@@ -436,7 +442,9 @@ private extension TestChatTransportState {
ts: Int(Date().timeIntervalSince1970 * 1000),
data: ["text": AnyCodable("external stream")])))
try await waitUntil("streaming active") { await MainActor.run { vm.streamingAssistantText == "external stream" } }
try await waitUntil("streaming active") {
await MainActor.run { vm.streamingAssistantText == "external stream" }
}
transport.emit(
.chat(

View File

@@ -80,7 +80,8 @@ import UniformTypeIdentifiers
}
let encoded = NSMutableData()
guard let dest = CGImageDestinationCreateWithData(encoded, UTType.jpeg.identifier as CFString, 1, nil) else {
guard let dest = CGImageDestinationCreateWithData(encoded, UTType.jpeg.identifier as CFString, 1, nil)
else {
throw NSError(domain: "JPEGTranscoderTests", code: 9)
}
CGImageDestinationAddImage(dest, img, nil)

View File

@@ -13,4 +13,3 @@ final class TalkPromptBuilderTests: XCTestCase {
XCTAssertTrue(prompt.contains("Assistant speech interrupted at 1.2s."))
}
}