VoiceWake: capture utterance and add prefix

This commit is contained in:
Peter Steinberger
2025-12-08 01:35:42 +01:00
parent 6415ae79be
commit a6e0ec38e7
7 changed files with 164 additions and 17 deletions

View File

@@ -73,4 +73,13 @@ import Testing
let escapedQuote = VoiceWakeForwarder.shellEscape(textWithQuote)
#expect(escapedQuote == "'Debug test works (and a funny pun)'\\'''")
}
@Test func prefixedTranscriptUsesMachineName() {
let transcript = "hello world"
let prefixed = VoiceWakeForwarder.prefixedTranscript(transcript, machineName: "My-Mac")
#expect(prefixed.starts(with: "User talked via voice recognition on"))
#expect(prefixed.contains("My-Mac"))
#expect(prefixed.hasSuffix("\n\nhello world"))
}
}