From 68cffef7ee34e726158c48f24069da4875d8e3a2 Mon Sep 17 00:00:00 2001 From: Roman Podymov Date: Wed, 20 Dec 2023 12:45:57 +0100 Subject: [PATCH] Fix tests --- Sources/CommonAppleKit/CAListView.swift | 2 +- Sources/CommonAppleKit/CAScrollableListView.swift | 4 ++-- Tests/CommonAppleKitTests/CommonAppleKitTests.swift | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/CommonAppleKit/CAListView.swift b/Sources/CommonAppleKit/CAListView.swift index ef31d54..fbcf2b7 100644 --- a/Sources/CommonAppleKit/CAListView.swift +++ b/Sources/CommonAppleKit/CAListView.swift @@ -8,7 +8,7 @@ import Foundation -open class CAListView, CellRootView, CellDataType: Any>: CACollectionView, CACollectionViewDataSource, CACollectionViewDelegate { +open class CAListView, CellRootView, CellDataType>: CACollectionView, CACollectionViewDataSource, CACollectionViewDelegate { private let cellId: String private weak var cellDelegate: CAListViewCellDelegate? diff --git a/Sources/CommonAppleKit/CAScrollableListView.swift b/Sources/CommonAppleKit/CAScrollableListView.swift index c610cfd..0e8c258 100644 --- a/Sources/CommonAppleKit/CAScrollableListView.swift +++ b/Sources/CommonAppleKit/CAScrollableListView.swift @@ -9,7 +9,7 @@ import Foundation #if canImport(AppKit) -open class CAScrollableListView, CellRootView, CellDataType: Any>: CAScrollView { +open class CAScrollableListView, CellRootView, CellDataType>: CAScrollView { public var content: [CellDataType] = [] { didSet { (documentView as? CAListView)?.content = content @@ -27,5 +27,5 @@ open class CAScrollableListView, CellRootView } } #elseif canImport(UIKit) -public typealias CAScrollableListView, CellRootView, CellDataType: Any> = CAListView +public typealias CAScrollableListView, CellRootView, CellDataType> = CAListView #endif diff --git a/Tests/CommonAppleKitTests/CommonAppleKitTests.swift b/Tests/CommonAppleKitTests/CommonAppleKitTests.swift index 9859f52..b1a36c3 100644 --- a/Tests/CommonAppleKitTests/CommonAppleKitTests.swift +++ b/Tests/CommonAppleKitTests/CommonAppleKitTests.swift @@ -106,13 +106,13 @@ final class CommonAppleKitTests: XCTestCase { } func testListView() { - let listView = CAListView(frame: .init(x: 0, y: 0, width: 300, height: 500), itemSize: .init(width: 200, height: 100), cellId: "id", cellDelegate: self) + let listView = CAListView(frame: .init(x: 0, y: 0, width: 300, height: 500), itemSize: .init(width: 200, height: 100), cellId: "id", cellDelegate: self) listView.content = ["one", "two"] } func testScrollableListView() { - let listView = CAScrollableListView(frame: .zero, itemSize: .init(width: 200, height: 100)) - listView.content = [] + let listView = CAScrollableListView(frame: .zero, itemSize: .init(width: 200, height: 100)) + listView.content = [1, 2] } }