From 548ad0ec026c15b5eb48f5fed7aa3390223d8ed7 Mon Sep 17 00:00:00 2001 From: Rachel Brindle Date: Tue, 6 Jun 2023 09:23:17 -0700 Subject: [PATCH] Fix building on Xcode 15 by specifying Nimble.Predicate --- .../DynamicSize/DynamicSizeSnapshot.swift | 4 ++-- .../HaveValidDynamicTypeSnapshot.swift | 20 +++++++++---------- Nimble_Snapshots/HaveValidSnapshot.swift | 8 ++++---- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Nimble_Snapshots/DynamicSize/DynamicSizeSnapshot.swift b/Nimble_Snapshots/DynamicSize/DynamicSizeSnapshot.swift index bab0343..5ea18d9 100644 --- a/Nimble_Snapshots/DynamicSize/DynamicSizeSnapshot.swift +++ b/Nimble_Snapshots/DynamicSize/DynamicSizeSnapshot.swift @@ -153,7 +153,7 @@ public func haveValidDynamicSizeSnapshot(named name: String? = pixelTolerance: CGFloat? = nil, tolerance: CGFloat? = nil, resizeMode: ResizeMode = .frame, - shouldIgnoreScale: Bool = false) -> Predicate { + shouldIgnoreScale: Bool = false) -> Nimble.Predicate { return Predicate { actualExpression in return performDynamicSizeSnapshotTest(name, identifier: identifier, @@ -250,7 +250,7 @@ public func recordDynamicSizeSnapshot(named name: String? = nil isDeviceAgnostic: Bool = false, usesDrawRect: Bool = false, resizeMode: ResizeMode = .frame, - shouldIgnoreScale: Bool = false) -> Predicate { + shouldIgnoreScale: Bool = false) -> Nimble.Predicate { return Predicate { actualExpression in return performDynamicSizeSnapshotTest(name, identifier: identifier, diff --git a/Nimble_Snapshots/DynamicType/HaveValidDynamicTypeSnapshot.swift b/Nimble_Snapshots/DynamicType/HaveValidDynamicTypeSnapshot.swift index 2826688..2f4cdf7 100644 --- a/Nimble_Snapshots/DynamicType/HaveValidDynamicTypeSnapshot.swift +++ b/Nimble_Snapshots/DynamicType/HaveValidDynamicTypeSnapshot.swift @@ -15,8 +15,8 @@ func shortCategoryName(_ category: UIContentSizeCategory) -> String { return category.rawValue.replacingOccurrences(of: "UICTContentSizeCategory", with: "") } -func combinePredicates(_ predicates: [Predicate], - deferred: (() -> Void)? = nil) -> Predicate { +func combinePredicates(_ predicates: [Nimble.Predicate], + deferred: (() -> Void)? = nil) -> Nimble.Predicate { return Predicate { actualExpression in defer { deferred?() @@ -37,18 +37,18 @@ public func haveValidDynamicTypeSnapshot(named name: String? = pixelTolerance: CGFloat? = nil, tolerance: CGFloat? = nil, sizes: [UIContentSizeCategory] = allContentSizeCategories(), - isDeviceAgnostic: Bool = false) -> Predicate { + isDeviceAgnostic: Bool = false) -> Nimble.Predicate { let mock = NBSMockedApplication() - let predicates: [Predicate] = sizes.map { category in + let predicates: [Nimble.Predicate] = sizes.map { category in let sanitizedName = sanitizedTestName(name) let nameWithCategory = "\(sanitizedName)_\(shortCategoryName(category))" - return Predicate { actualExpression in + return Nimble.Predicate { actualExpression in mock.mockPreferredContentSizeCategory(category) updateTraitCollection(on: actualExpression) - let predicate: Predicate + let predicate: Nimble.Predicate if isDeviceAgnostic { predicate = haveValidDeviceAgnosticSnapshot(named: nameWithCategory, identifier: identifier, usesDrawRect: usesDrawRect, pixelTolerance: pixelTolerance, @@ -74,18 +74,18 @@ public func recordDynamicTypeSnapshot(named name: String? = nil identifier: String? = nil, usesDrawRect: Bool = false, sizes: [UIContentSizeCategory] = allContentSizeCategories(), - isDeviceAgnostic: Bool = false) -> Predicate { + isDeviceAgnostic: Bool = false) -> Nimble.Predicate { let mock = NBSMockedApplication() - let predicates: [Predicate] = sizes.map { category in + let predicates: [Nimble.Predicate] = sizes.map { category in let sanitizedName = sanitizedTestName(name) let nameWithCategory = "\(sanitizedName)_\(shortCategoryName(category))" - return Predicate { actualExpression in + return Nimble.Predicate { actualExpression in mock.mockPreferredContentSizeCategory(category) updateTraitCollection(on: actualExpression) - let predicate: Predicate + let predicate: Nimble.Predicate if isDeviceAgnostic { predicate = recordDeviceAgnosticSnapshot(named: nameWithCategory, identifier: identifier, diff --git a/Nimble_Snapshots/HaveValidSnapshot.swift b/Nimble_Snapshots/HaveValidSnapshot.swift index eb650d4..41537b8 100644 --- a/Nimble_Snapshots/HaveValidSnapshot.swift +++ b/Nimble_Snapshots/HaveValidSnapshot.swift @@ -280,7 +280,7 @@ public func haveValidSnapshot(named name: String? = nil, usesDrawRect: Bool = false, pixelTolerance: CGFloat? = nil, tolerance: CGFloat? = nil, - shouldIgnoreScale: Bool = false) -> Predicate { + shouldIgnoreScale: Bool = false) -> Nimble.Predicate { return Predicate { actualExpression in if switchChecksWithRecords { @@ -306,7 +306,7 @@ public func haveValidDeviceAgnosticSnapshot(named name: String? usesDrawRect: Bool = false, pixelTolerance: CGFloat? = nil, tolerance: CGFloat? = nil, - shouldIgnoreScale: Bool = false) -> Predicate { + shouldIgnoreScale: Bool = false) -> Nimble.Predicate { return Predicate { actualExpression in if switchChecksWithRecords { @@ -332,7 +332,7 @@ public func haveValidDeviceAgnosticSnapshot(named name: String? public func recordSnapshot(named name: String? = nil, identifier: String? = nil, usesDrawRect: Bool = false, - shouldIgnoreScale: Bool = false) -> Predicate { + shouldIgnoreScale: Bool = false) -> Nimble.Predicate { return Predicate { actualExpression in return recordSnapshot(name, identifier: identifier, usesDrawRect: usesDrawRect, @@ -344,7 +344,7 @@ public func recordSnapshot(named name: String? = nil, public func recordDeviceAgnosticSnapshot(named name: String? = nil, identifier: String? = nil, usesDrawRect: Bool = false, - shouldIgnoreScale: Bool = false) -> Predicate { + shouldIgnoreScale: Bool = false) -> Nimble.Predicate { return Predicate { actualExpression in return recordSnapshot(name, identifier: identifier, isDeviceAgnostic: true, usesDrawRect: usesDrawRect,