test(dev-local): cover native locale forwarding

This commit is contained in:
jjbrunton committed 2026-09-21 21:41:45 +01:00
1 parent 15c7894bec
commit e417f7f79a
1 file changed
+13
+13
View File
@@ -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/);
});