فهرست منبع

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.
ericcaiwx-star 1 ماه پیش
والد
کامیت
9a2217b74a
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      packages/host/directory-picker-native/tests/win32-dialog-bindings.spec.ts

+ 2 - 2
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 () => {