From 9a2217b74a5cd16f2d7b395dc3ddd17baf22db93 Mon Sep 17 00:00:00 2001 From: ericcaiwx-star Date: Fri, 14 Aug 2026 14:47:01 +0800 Subject: [PATCH] test(directory-picker-win32): use a synthetic path in the UTF-16 fixture The U+5F00 case only needs that code unit in the buffer. A real-looking user desktop path does not belong in a public fixture. --- .../tests/win32-dialog-bindings.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/host/directory-picker-native/tests/win32-dialog-bindings.spec.ts b/packages/host/directory-picker-native/tests/win32-dialog-bindings.spec.ts index 142cc257f7..85d4aed48b 100644 --- a/packages/host/directory-picker-native/tests/win32-dialog-bindings.spec.ts +++ b/packages/host/directory-picker-native/tests/win32-dialog-bindings.spec.ts @@ -183,10 +183,10 @@ describe('loadWin32DialogBindings over the fake COM world', () => { it('reads a UTF-16 path whose BMP code unit has a zero low byte (U+5F00 开)', async () => { // 开 = U+5F00 → UTF-16LE bytes 00 5F. A scan that treats any zero low // byte as NUL truncates here and returns the nonexistent ...\安卓. - const world = comWorld({ path: 'C:\\Users\\XIAOPAN\\Desktop\\安卓开发' }) + const world = comWorld({ path: 'C:\\fixture\\安卓开发' }) installFakeKoffi(world) const bindings = await (await loadBindingsModule()).loadWin32DialogBindings() - expect(runFolderDialog(bindings, 'Pick', vi.fn())).toBe('C:\\Users\\XIAOPAN\\Desktop\\安卓开发') + expect(runFolderDialog(bindings, 'Pick', vi.fn())).toBe('C:\\fixture\\安卓开发') }) it('maps dismissal and the S_FALSE CoInitializeEx', async () => {