restores Helder in all its glory

This commit is contained in:
2026-09-28 11:34:49 +02:00
parent c2b38b853c
commit 1d29d0952d
280 changed files with 29205 additions and 7 deletions
@@ -0,0 +1,38 @@
import Foundation
import HelderCore
import HelderServices
/// Declared class names and lookups set by the test; counts invalidations.
final class FakeSymbols: SymbolServicing, @unchecked Sendable {
private struct State {
var declared: Set<String> = []
var lookups: [String: SymbolLookup] = [:]
var invalidations = 0
var nameLoads = 0
}
private let state = Locked(State())
var declared: Set<String> {
get { state.current.declared }
set { state.mutate { $0.declared = newValue } }
}
var lookups: [String: SymbolLookup] {
get { state.current.lookups }
set { state.mutate { $0.lookups = newValue } }
}
var invalidations: Int { state.current.invalidations }
var nameLoads: Int { state.current.nameLoads }
func names() async -> Set<String> {
state.mutate { state in
state.nameLoads += 1
return state.declared
}
}
func lookup(_ name: String) async -> SymbolLookup { state.current.lookups[name] ?? .empty(name) }
func invalidate() async { state.mutate { $0.invalidations += 1 } }
}