From e417f7f79ad02f10805acea4dba52c43cb0a6f15 Mon Sep 17 00:00:00 2001 From: jjbrunton Date: Mon, 21 Sep 2026 21:41:45 +0100 Subject: [PATCH] test(dev-local): cover native locale forwarding --- scripts/dev-local.test.mjs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 scripts/dev-local.test.mjs diff --git a/scripts/dev-local.test.mjs b/scripts/dev-local.test.mjs new file mode 100644 index 0000000..19fea79 --- /dev/null +++ b/scripts/dev-local.test.mjs @@ -0,0 +1,13 @@ +import assert from 'node:assert/strict'; +import { readFile } from 'node:fs/promises'; +import test from 'node:test'; +import { fileURLToPath } from 'node:url'; + +const launcherPath = fileURLToPath(new URL('./dev-local.sh', import.meta.url)); + +test('native launcher retains a UTF-8 locale after sanitizing its environment', async () => { + const launcher = await readFile(launcherPath, 'utf8'); + const nativeCommand = launcher.slice(launcher.indexOf('cmd_native() {'), launcher.indexOf('\ncase "${1:-up}" in')); + + assert.match(nativeCommand, /env -i[\s\S]*LANG=en_US\.UTF-8 LC_ALL=en_US\.UTF-8/); +});