mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-09-19 05:00:48 +00:00
fix: import BitFoundation so ComposerDraftStore sees PeerID
iOS target build failed without the module import that SPM resolved transitively but Xcode did not. Also keep the eviction test inside the test suite type.
This commit is contained in:
parent
7d5dee2347
commit
fa9c69aa0e
@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import BitFoundation
|
||||
|
||||
/// Persists unfinished composer text per conversation so switching mesh /
|
||||
/// geohash / DM channels does not silently discard what someone was typing.
|
||||
|
||||
@ -61,12 +61,15 @@ struct ComposerDraftStoreTests {
|
||||
#expect(ComposerDraftStore.load(.mesh, in: defaults).isEmpty)
|
||||
#expect(defaults.object(forKey: ComposerDraftStore.storageKey) == nil)
|
||||
}
|
||||
}
|
||||
|
||||
@Test func maxDraftCountEvictsSurplusKeys() {
|
||||
let defaults = makeDefaults()
|
||||
for index in 0..<ComposerDraftStore.maxDraftCount {
|
||||
ComposerDraftStore.save("d\(index)", for: .location(geohash: String(format: "gh%04d", index)), in: defaults)
|
||||
ComposerDraftStore.save(
|
||||
"d\(index)",
|
||||
for: .location(geohash: String(format: "gh%04d", index)),
|
||||
in: defaults
|
||||
)
|
||||
}
|
||||
ComposerDraftStore.save("newest", for: .mesh, in: defaults)
|
||||
let map = defaults.dictionary(forKey: ComposerDraftStore.storageKey) as? [String: String] ?? [:]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user