From b32ca44f8795f92d802b3d7821bcd54c876ae0d1 Mon Sep 17 00:00:00 2001 From: Sjmarf <78750526+Sjmarf@users.noreply.github.com> Date: Sun, 24 Sep 2023 14:55:19 +0100 Subject: [PATCH] Testing --- MlemTests/Persistence/PersistenceRepositoryTests.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MlemTests/Persistence/PersistenceRepositoryTests.swift b/MlemTests/Persistence/PersistenceRepositoryTests.swift index d2a3fd2cd..9219cfd29 100644 --- a/MlemTests/Persistence/PersistenceRepositoryTests.swift +++ b/MlemTests/Persistence/PersistenceRepositoryTests.swift @@ -120,16 +120,16 @@ final class PersistenceRepositoryTests: XCTestCase { // MARK: - Recent Searches func testSaveRecentSearches() async throws { - let searches = ["these", "are", "some", "terms"] + let searches: [ContentModelIdentifier] = [.init(contentType: .user, contentId: 1), .init(contentType: .community, contentId: 2)] try await repository.saveRecentSearches(searches) // write the examples to disk - let searchesFromDisk = try load([String].self) // load them from the disk _without_ using the repository + let searchesFromDisk = try load([ContentModelIdentifier].self) // load them from the disk _without_ using the repository XCTAssertEqual(searches, searchesFromDisk) // confirm what was written to disk matches what we sent in } func testLoadRecentSearchesWithValues() async throws { - let searches = ["these", "are", "some", "terms"] + let searches: [ContentModelIdentifier] = [.init(contentType: .user, contentId: 1), .init(contentType: .community, contentId: 2)] try await repository.saveRecentSearches(searches) // write the example terms to the disk let loadedSearches = repository.loadRecentSearches() // read them back