From c887c313cd6f28cd66e3d68c1880f04cb5d95f16 Mon Sep 17 00:00:00 2001 From: Taksh Date: Fri, 31 Jul 2026 11:44:52 +0300 Subject: [PATCH] test: assert composer draft map stays within maxDraftCount Newest keys win when the store is already full so prefs cannot grow without bound. --- bitchatTests/Services/ComposerDraftStoreTests.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bitchatTests/Services/ComposerDraftStoreTests.swift b/bitchatTests/Services/ComposerDraftStoreTests.swift index e318a7e0..4677f263 100644 --- a/bitchatTests/Services/ComposerDraftStoreTests.swift +++ b/bitchatTests/Services/ComposerDraftStoreTests.swift @@ -62,3 +62,15 @@ struct ComposerDraftStoreTests { #expect(defaults.object(forKey: ComposerDraftStore.storageKey) == nil) } } + + @Test func maxDraftCountEvictsSurplusKeys() { + let defaults = makeDefaults() + for index in 0..