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

View File

@@ -15,6 +15,8 @@ GIT_COMMIT=$(cd "$ROOT_DIR" && git rev-parse --short HEAD 2>/dev/null || echo "u
APP_VERSION="${APP_VERSION:-$PKG_VERSION}"
APP_BUILD="${APP_BUILD:-$PKG_VERSION}"
echo "📦 Ensuring deps (pnpm install)"
(cd "$ROOT_DIR" && pnpm install --no-frozen-lockfile --config.node-linker=hoisted)
echo "📦 Building JS (pnpm exec tsc)"
(cd "$ROOT_DIR" && pnpm exec tsc -p tsconfig.json)
@@ -117,7 +119,7 @@ pnpm install \
--config.shared-workspace-lockfile=false \
--lockfile-dir "$ROOT_DIR" \
--dir "$TMP_DEPLOY"
rsync -a "$TMP_DEPLOY/node_modules" "$RELAY_DIR/"
rsync -aL "$TMP_DEPLOY/node_modules" "$RELAY_DIR/"
rm -rf "$TMP_DEPLOY"
if [ -f "$CLI_BIN" ]; then