Files
Sprachmittler/Packages/SprachmittlerKit/Tests/SprachmittlerCoreTests/LogRedactionTests.swift
T
schihei 7ca5c710ec feat(m0): complete scaffold, logging and signature checks (T0.2-T0.6)
Add os.Logger categories, OSSignposter wrapper and shortHash helper; enforce exact Debug/Release/install signatures; lint tests; update M0 docs and progress.
2026-11-26 12:33:51 +01:00

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"))
}
}