Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjmarf committed Sep 24, 2023
1 parent 06c2607 commit b32ca44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MlemTests/Persistence/PersistenceRepositoryTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b32ca44

Please sign in to comment.