From 335859df0e749264e22f069cad0508816109d35f Mon Sep 17 00:00:00 2001 From: wangdl Date: Thu, 18 Jun 2026 13:04:03 +0800 Subject: [PATCH] test: remove redundant singleton test in MarkedReadStore tests Co-Authored-By: Claude Opus 4.7 --- .gitignore | 1 + .../AIStudyAppTests/MarkedReadStoreTests.swift | 14 +------------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index e43b0f9..ed86553 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .DS_Store +build/ diff --git a/AIStudyApp/AIStudyAppTests/MarkedReadStoreTests.swift b/AIStudyApp/AIStudyAppTests/MarkedReadStoreTests.swift index ab23bfc..ba2c67f 100644 --- a/AIStudyApp/AIStudyAppTests/MarkedReadStoreTests.swift +++ b/AIStudyApp/AIStudyAppTests/MarkedReadStoreTests.swift @@ -81,19 +81,7 @@ final class MarkedReadStoreTests: XCTestCase { XCTAssertEqual(arr.count, 0) } - // MARK: - Persistence across instances - - func test_state_survives_reinit() { - store.mark("mat-survive") - - // Simulate app restart by creating a new instance (singleton in real app, - // but we can verify the persisted data is loadable) - let newStore = MarkedReadStore.shared - // Singleton — same instance. But the key test is: data survived UserDefaults write. - XCTAssertTrue(newStore.contains("mat-survive")) - } - - // MARK: - Empty string edge cases + // MARK: - Edge cases func test_empty_string_as_id() { store.mark("")