diff --git a/macos/Tests/Helpers/MockView.swift b/macos/Tests/Helpers/MockView.swift deleted file mode 100644 index 41629832a..000000000 --- a/macos/Tests/Helpers/MockView.swift +++ /dev/null @@ -1,27 +0,0 @@ -import AppKit - -// @preconcurrency suppresses Sendable errors from Codable on NSView -// but the Swift compiler still complains about it. -class MockView: NSView, @preconcurrency Codable, Identifiable { - let id: UUID - - init(id: UUID = UUID()) { - self.id = id - super.init(frame: .zero) - } - - required init?(coder: NSCoder) { fatalError() } - - enum CodingKeys: CodingKey { case id } - - required init(from decoder: Decoder) throws { - let c = try decoder.container(keyedBy: CodingKeys.self) - self.id = try c.decode(UUID.self, forKey: .id) - super.init(frame: .zero) - } - - func encode(to encoder: Encoder) throws { - var c = encoder.container(keyedBy: CodingKeys.self) - try c.encode(id, forKey: .id) - } -} diff --git a/macos/Tests/Splits/SplitTreeTests.swift b/macos/Tests/Splits/SplitTreeTests.swift index 8c64e938a..5ef84b8ec 100644 --- a/macos/Tests/Splits/SplitTreeTests.swift +++ b/macos/Tests/Splits/SplitTreeTests.swift @@ -2,6 +2,30 @@ import AppKit import Testing @testable import Ghostty +class MockView: NSView, Codable, Identifiable { + let id: UUID + + init(id: UUID = UUID()) { + self.id = id + super.init(frame: .zero) + } + + required init?(coder: NSCoder) { fatalError() } + + enum CodingKeys: CodingKey { case id } + + required init(from decoder: Decoder) throws { + let c = try decoder.container(keyedBy: CodingKeys.self) + self.id = try c.decode(UUID.self, forKey: .id) + super.init(frame: .zero) + } + + func encode(to encoder: Encoder) throws { + var c = encoder.container(keyedBy: CodingKeys.self) + try c.encode(id, forKey: .id) + } +} + struct SplitTreeTests { /// Creates a two-view horizontal split tree (view1 | view2). private func makeHorizontalSplit() throws -> (SplitTree, MockView, MockView) {