Add os.Logger categories, OSSignposter wrapper and shortHash helper; enforce exact Debug/Release/install signatures; lint tests; update M0 docs and progress.
17 lines
587 B
Swift
17 lines
587 B
Swift
import Testing
|
|
@testable import SprachmittlerCore
|
|
|
|
/// T0.4: SP-2 allows short hashes in logs, never the underlying text.
|
|
@Suite("Log redaction")
|
|
struct LogRedactionTests {
|
|
@Test func shortHashIsStableTwelveHexAndOpaque() {
|
|
let hash = LogRedaction.shortHash("hello")
|
|
#expect(hash == "2cf24dba5fb0")
|
|
#expect(hash == LogRedaction.shortHash("hello"))
|
|
#expect(hash.count == 12)
|
|
#expect(hash.allSatisfy { $0.isHexDigit && !$0.isUppercase })
|
|
#expect(hash != LogRedaction.shortHash("hello!"))
|
|
#expect(!hash.contains("hello"))
|
|
}
|
|
}
|