2025-12-09 19:51:51 +01:00
|
|
|
import Foundation
|
|
|
|
|
import Testing
|
2026-01-30 03:15:10 +01:00
|
|
|
@testable import OpenClaw
|
2025-12-09 19:51:51 +01:00
|
|
|
|
2026-03-08 13:22:46 +00:00
|
|
|
struct VoiceWakeOverlayTests {
|
|
|
|
|
@Test func `guard token drops when no active`() {
|
2025-12-09 19:51:51 +01:00
|
|
|
let outcome = VoiceWakeOverlayController.evaluateToken(active: nil, incoming: UUID())
|
2025-12-10 00:47:49 +01:00
|
|
|
#expect(outcome == .dropNoActive)
|
2025-12-09 19:51:51 +01:00
|
|
|
}
|
|
|
|
|
|
2026-03-08 13:22:46 +00:00
|
|
|
@Test func `guard token accepts matching`() {
|
2025-12-09 19:51:51 +01:00
|
|
|
let token = UUID()
|
|
|
|
|
let outcome = VoiceWakeOverlayController.evaluateToken(active: token, incoming: token)
|
|
|
|
|
#expect(outcome == .accept)
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-08 13:22:46 +00:00
|
|
|
@Test func `guard token drops mismatch without dismissing`() {
|
2025-12-09 19:51:51 +01:00
|
|
|
let outcome = VoiceWakeOverlayController.evaluateToken(active: UUID(), incoming: UUID())
|
2025-12-10 00:47:49 +01:00
|
|
|
#expect(outcome == .dropMismatch)
|
2025-12-09 19:51:51 +01:00
|
|
|
}
|
|
|
|
|
}
|