From 8b3f49e49838a3677ec62da2abfe39306d0e2ca3 Mon Sep 17 00:00:00 2001 From: Andrew Roan Date: Thu, 25 Jan 2024 22:47:44 -0600 Subject: [PATCH] Fix warnings and run swiftformat 3.0-preview --- Tests/CoreDataRepositoryTests/CRUDRepositoryTests.swift | 3 +-- Tests/CoreDataRepositoryTests/CoreDataXCTestCase.swift | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Tests/CoreDataRepositoryTests/CRUDRepositoryTests.swift b/Tests/CoreDataRepositoryTests/CRUDRepositoryTests.swift index 3aa245d..7955f3f 100644 --- a/Tests/CoreDataRepositoryTests/CRUDRepositoryTests.swift +++ b/Tests/CoreDataRepositoryTests/CRUDRepositoryTests.swift @@ -32,10 +32,9 @@ final class CRUDRepositoryTests: CoreDataXCTestCase { } func testCreateFailure() async throws { - let historyTimeStamp = Date() let transactionAuthor: String = #function let movie = Movie(id: UUID(), title: "Create Success", releaseDate: Date(), boxOffice: 100) - var existingMovie = try await repositoryContext().perform(schedule: .immediate) { + let existingMovie = try await repositoryContext().perform(schedule: .immediate) { let object = try ManagedMovie(context: self.repositoryContext()) try movie.updating(managed: object) try self.repositoryContext().save() diff --git a/Tests/CoreDataRepositoryTests/CoreDataXCTestCase.swift b/Tests/CoreDataRepositoryTests/CoreDataXCTestCase.swift index 948208e..c074cfe 100644 --- a/Tests/CoreDataRepositoryTests/CoreDataXCTestCase.swift +++ b/Tests/CoreDataRepositoryTests/CoreDataXCTestCase.swift @@ -90,7 +90,7 @@ class CoreDataXCTestCase: XCTestCase { let historyResult = try XCTUnwrap(repositoryContext().execute(historyRequest) as? NSPersistentHistoryResult) let history = try XCTUnwrap(historyResult.result as? [NSPersistentHistoryTransaction]) XCTAssertGreaterThan(history.count, 0) - history.forEach { historyTransaction in + for historyTransaction in history { XCTAssertEqual(historyTransaction.author, transactionAuthor) } }