VoiceWake: add escaping regression tests

This commit is contained in:
Peter Steinberger
2025-12-07 18:25:07 +01:00
parent b3f79e5b02
commit fb2a7d8cd1
2 changed files with 13 additions and 1 deletions

View File

@@ -63,4 +63,14 @@ import Testing
#expect(!command.contains("/tmp/custom-cli"))
}
@Test func shellEscapeHandlesQuotesAndParens() {
let text = "Debug test works (and a funny pun)"
let escaped = VoiceWakeForwarder.shellEscape(text)
#expect(escaped == "'Debug test works (and a funny pun)'")
let textWithQuote = "Debug test works (and a funny pun)'"
let escapedQuote = VoiceWakeForwarder.shellEscape(textWithQuote)
#expect(escapedQuote == "'Debug test works (and a funny pun)'\\'''")
}
}