Fix test target build after split test sync

This commit is contained in:
Lawrence Chen 2026-03-18 03:49:24 -07:00
parent 34a5f71bde
commit e99bc40285
No known key found for this signature in database
6 changed files with 48 additions and 48 deletions

View file

@ -6,7 +6,7 @@ import XCTest
@testable import cmux
#endif
private let lastSurfaceCloseShortcutDefaultsKey = "closeWorkspaceOnLastSurfaceShortcut"
private let appDelegateLastSurfaceCloseShortcutDefaultsKey = "closeWorkspaceOnLastSurfaceShortcut"
@MainActor
final class AppDelegateShortcutRoutingTests: XCTestCase {
@ -725,13 +725,13 @@ final class AppDelegateShortcutRoutingTests: XCTestCase {
}
let defaults = UserDefaults.standard
let originalSetting = defaults.object(forKey: lastSurfaceCloseShortcutDefaultsKey)
defaults.set(false, forKey: lastSurfaceCloseShortcutDefaultsKey)
let originalSetting = defaults.object(forKey: appDelegateLastSurfaceCloseShortcutDefaultsKey)
defaults.set(false, forKey: appDelegateLastSurfaceCloseShortcutDefaultsKey)
defer {
if let originalSetting {
defaults.set(originalSetting, forKey: lastSurfaceCloseShortcutDefaultsKey)
defaults.set(originalSetting, forKey: appDelegateLastSurfaceCloseShortcutDefaultsKey)
} else {
defaults.removeObject(forKey: lastSurfaceCloseShortcutDefaultsKey)
defaults.removeObject(forKey: appDelegateLastSurfaceCloseShortcutDefaultsKey)
}
}

View file

@ -2737,43 +2737,6 @@ final class CmuxWebViewDragRoutingTests: XCTestCase {
}
}
#if compiler(>=6.2)
@available(macOS 26.0, *)
private struct DragConfigurationOperationsSnapshot: Equatable {
let allowCopy: Bool
let allowMove: Bool
let allowDelete: Bool
let allowAlias: Bool
}
@available(macOS 26.0, *)
private enum DragConfigurationSnapshotError: Error {
case missingBoolField(primary: String, fallback: String?)
}
@available(macOS 26.0, *)
private func dragConfigurationOperationsSnapshot<T>(from operations: T) throws -> DragConfigurationOperationsSnapshot {
let mirror = Mirror(reflecting: operations)
func readBool(_ primary: String, fallback: String? = nil) throws -> Bool {
if let value = mirror.descendant(primary) as? Bool {
return value
}
if let fallback, let value = mirror.descendant(fallback) as? Bool {
return value
}
throw DragConfigurationSnapshotError.missingBoolField(primary: primary, fallback: fallback)
}
return try DragConfigurationOperationsSnapshot(
allowCopy: readBool("allowCopy", fallback: "_allowCopy"),
allowMove: readBool("allowMove", fallback: "_allowMove"),
allowDelete: readBool("allowDelete", fallback: "_allowDelete"),
allowAlias: readBool("allowAlias", fallback: "_allowAlias")
)
}
final class BrowserLinkOpenSettingsTests: XCTestCase {
private var suiteName: String!
private var defaults: UserDefaults!

View file

@ -13,7 +13,7 @@ import UserNotifications
@testable import cmux
#endif
func drainMainQueue() {
private func drainBrowserPanelMainQueue() {
let expectation = XCTestExpectation(description: "drain main queue")
DispatchQueue.main.async {
expectation.fulfill()
@ -22,7 +22,7 @@ func drainMainQueue() {
}
@MainActor
func makeTemporaryBrowserProfile(named prefix: String) throws -> BrowserProfileDefinition {
private func makeTemporaryBrowserPanelProfile(named prefix: String) throws -> BrowserProfileDefinition {
try XCTUnwrap(
BrowserProfileStore.shared.createProfile(
named: "\(prefix)-\(UUID().uuidString)"
@ -107,7 +107,7 @@ final class BrowserPanelOmnibarPillBackgroundColorTests: XCTestCase {
@MainActor
final class BrowserPanelProfileIsolationTests: XCTestCase {
func testStaleDidFinishDoesNotRecordVisitIntoSwitchedProfileHistory() throws {
let alternateProfile = try makeTemporaryBrowserProfile(named: "Switched")
let alternateProfile = try makeTemporaryBrowserPanelProfile(named: "Switched")
let defaultStore = BrowserHistoryStore.shared
let alternateStore = BrowserProfileStore.shared.historyStore(for: alternateProfile.id)
defaultStore.clearHistory()
@ -137,7 +137,7 @@ final class BrowserPanelProfileIsolationTests: XCTestCase {
alternateStore.clearHistory()
staleDelegate.webView?(staleWebView, didFinish: nil)
drainMainQueue()
drainBrowserPanelMainQueue()
XCTAssertTrue(
defaultStore.entries.isEmpty,

View file

@ -299,6 +299,42 @@ final class FocusFlashPatternTests: XCTestCase {
}
@available(macOS 26.0, *)
private struct DragConfigurationOperationsSnapshot: Equatable {
let allowCopy: Bool
let allowMove: Bool
let allowDelete: Bool
let allowAlias: Bool
}
@available(macOS 26.0, *)
private enum DragConfigurationSnapshotError: Error {
case missingBoolField(primary: String, fallback: String?)
}
@available(macOS 26.0, *)
private func dragConfigurationOperationsSnapshot<T>(from operations: T) throws -> DragConfigurationOperationsSnapshot {
let mirror = Mirror(reflecting: operations)
func readBool(_ primary: String, fallback: String? = nil) throws -> Bool {
if let value = mirror.descendant(primary) as? Bool {
return value
}
if let fallback, let value = mirror.descendant(fallback) as? Bool {
return value
}
throw DragConfigurationSnapshotError.missingBoolField(primary: primary, fallback: fallback)
}
return try DragConfigurationOperationsSnapshot(
allowCopy: readBool("allowCopy", fallback: "_allowCopy"),
allowMove: readBool("allowMove", fallback: "_allowMove"),
allowDelete: readBool("allowDelete", fallback: "_allowDelete"),
allowAlias: readBool("allowAlias", fallback: "_allowAlias")
)
}
#if compiler(>=6.2)
@MainActor
final class InternalTabDragConfigurationTests: XCTestCase {
func testDisablesExternalOperationsForInternalTabDrags() throws {
@ -1080,3 +1116,4 @@ final class MarkdownPanelPointerObserverViewTests: XCTestCase {
XCTAssertNil(overlay.hitTest(NSPoint(x: 40, y: 30)))
}
}
#endif

View file

@ -7,6 +7,7 @@ import AppKit
@testable import cmux
#endif
@MainActor
final class WorkspaceManualUnreadTests: XCTestCase {
func testShouldClearManualUnreadWhenFocusMovesToDifferentPanel() {
let previousFocusedPanelId = UUID()
@ -281,7 +282,7 @@ final class CommandPaletteSwitcherSearchIndexerTests: XCTestCase {
XCTAssertFalse(keywords.contains("cmd-palette-indexing"))
}
func testSurfaceDetailOutranksWorkspaceDetailForPathToken() {
func testSurfaceDetailOutranksWorkspaceDetailForPathToken() throws {
let metadata = CommandPaletteSwitcherSearchMetadata(
directories: ["/tmp/worktrees/cmux"],
branches: ["feature/cmd-palette"],

View file

@ -1896,4 +1896,3 @@ final class SidebarWorkspaceShortcutHintMetricsTests: XCTestCase {
XCTAssertGreaterThan(widened, base)
}
}
#endif