From 2c22cd2458e7438004e75f71f094134c8c64d151 Mon Sep 17 00:00:00 2001 From: Robert MacEachern Date: Wed, 18 Dec 2024 11:46:01 -0600 Subject: [PATCH 1/2] Moves CacheClearer files to proper locations --- CacheClearer.swift => ListableUI/Sources/CacheClearer.swift | 0 .../Tests/CacheClearerTests.swift | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename CacheClearer.swift => ListableUI/Sources/CacheClearer.swift (100%) rename CacheClearerTests.swift => ListableUI/Tests/CacheClearerTests.swift (100%) diff --git a/CacheClearer.swift b/ListableUI/Sources/CacheClearer.swift similarity index 100% rename from CacheClearer.swift rename to ListableUI/Sources/CacheClearer.swift diff --git a/CacheClearerTests.swift b/ListableUI/Tests/CacheClearerTests.swift similarity index 100% rename from CacheClearerTests.swift rename to ListableUI/Tests/CacheClearerTests.swift From fc39dfdc83616dd2b9ac730bc96626643beba050 Mon Sep 17 00:00:00 2001 From: Robert MacEachern Date: Wed, 18 Dec 2024 11:59:18 -0600 Subject: [PATCH 2/2] More flexible CacheClearerTests to account for full suite run that may have pre-populated the caches --- ListableUI/Tests/CacheClearerTests.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ListableUI/Tests/CacheClearerTests.swift b/ListableUI/Tests/CacheClearerTests.swift index 449befe7..d31404f1 100644 --- a/ListableUI/Tests/CacheClearerTests.swift +++ b/ListableUI/Tests/CacheClearerTests.swift @@ -8,8 +8,8 @@ class CacheClearerTests: XCTestCase { ListProperties.headerFooterMeasurementCache.push(UIView(), with: .identifier(for: UIView.self)) ListProperties.itemMeasurementCache.push(UIView(), with: .identifier(for: UIView.self)) - XCTAssertEqual(ListProperties.headerFooterMeasurementCache.cachedViewCount, 1) - XCTAssertEqual(ListProperties.itemMeasurementCache.cachedViewCount, 1) + XCTAssertGreaterThanOrEqual(ListProperties.headerFooterMeasurementCache.cachedViewCount, 1) + XCTAssertGreaterThanOrEqual(ListProperties.itemMeasurementCache.cachedViewCount, 1) CacheClearer.clearStaticCaches()