From c718e8782cab1088a63e6f6f9689ce222e085dc5 Mon Sep 17 00:00:00 2001 From: NachoSoto Date: Fri, 9 Jun 2023 07:43:17 -0700 Subject: [PATCH] Fixed test compilation with `Xcode 15` (#2602) --- Tests/UnitTests/Networking/NetworkErrorTests.swift | 2 +- .../Purchases/TransactionPosterTests.swift | 2 +- Tests/UnitTests/TestHelpers/Matchers.swift | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Tests/UnitTests/Networking/NetworkErrorTests.swift b/Tests/UnitTests/Networking/NetworkErrorTests.swift index 620495727b..c8cb7a0bc1 100644 --- a/Tests/UnitTests/Networking/NetworkErrorTests.swift +++ b/Tests/UnitTests/Networking/NetworkErrorTests.swift @@ -289,7 +289,7 @@ class NetworkErrorTests: TestCase { } private func check( - _ value: T, condition: Predicate, descrition: String, + _ value: T, condition: Nimble.Predicate, descrition: String, file: FileString = #file, line: UInt = #line ) { expect( diff --git a/Tests/UnitTests/Purchasing/Purchases/TransactionPosterTests.swift b/Tests/UnitTests/Purchasing/Purchases/TransactionPosterTests.swift index 1ee1aaff79..6ab61e960a 100644 --- a/Tests/UnitTests/Purchasing/Purchases/TransactionPosterTests.swift +++ b/Tests/UnitTests/Purchasing/Purchases/TransactionPosterTests.swift @@ -155,7 +155,7 @@ private extension TransactionPosterTests { } -private func match(_ data: PurchasedTransactionData) -> Predicate { +private func match(_ data: PurchasedTransactionData) -> Nimble.Predicate { return .init { let other = try $0.evaluate() let matches = (other?.appUserID == data.appUserID && diff --git a/Tests/UnitTests/TestHelpers/Matchers.swift b/Tests/UnitTests/TestHelpers/Matchers.swift index d4c05ebe68..4a367d94f9 100644 --- a/Tests/UnitTests/TestHelpers/Matchers.swift +++ b/Tests/UnitTests/TestHelpers/Matchers.swift @@ -17,11 +17,11 @@ import Nimble // MARK: - Dates -func beCloseToNow() -> Predicate { +func beCloseToNow() -> Nimble.Predicate { return beCloseToDate(Date()) } -func beCloseToDate(_ expectedValue: Date) -> Predicate { +func beCloseToDate(_ expectedValue: Date) -> Nimble.Predicate { return beCloseTo(expectedValue, within: 1) } @@ -32,31 +32,31 @@ func beCloseToDate(_ expectedValue: Date) -> Predicate { /// Overload for `Nimble.matchError` that ignores the `PurchasesError` type and compares them as `Error` /// (comparing the domain and code) -func matchError(_ error: PurchasesError) -> Predicate { +func matchError(_ error: PurchasesError) -> Nimble.Predicate { return Nimble.matchError(error as Error) } /// Overload for `Nimble.matchError` that ignores the `ErrorCode` type and compares them as `Error` /// (comparing the domain and code) -func matchError(_ error: ErrorCode) -> Predicate { +func matchError(_ error: ErrorCode) -> Nimble.Predicate { return Nimble.matchError(error as Error) } /// Overload for `Nimble.throwError` that ignores the `PurchasesError` type and compares them as `Error` /// (comparing the domain and code) -public func throwError(_ error: PurchasesError) -> Predicate { +public func throwError(_ error: PurchasesError) -> Nimble.Predicate { return Nimble.throwError(error as Error) } /// Overload for `Nimble.throwError` that ignores the `ErrorCode` type and compares them as `Error` /// (comparing the domain and code) -public func throwError(_ error: ErrorCode) -> Predicate { +public func throwError(_ error: ErrorCode) -> Nimble.Predicate { return Nimble.throwError(error as Error) } // MARK: - Data -func matchJSONData(_ other: Data) -> Predicate { +func matchJSONData(_ other: Data) -> Nimble.Predicate { return equal(other.serialized) }