补齐移动壳剪贴板Unicode截断覆盖
移动壳剪贴板测试覆盖多字节文本按共享上限截断 移动壳配置检查反查剪贴板 Unicode 截断用例
This commit is contained in:
@@ -1797,6 +1797,9 @@ for (const snippet of [
|
||||
throw new Error(`mobile shell clipboard module is missing ${snippet}`);
|
||||
}
|
||||
}
|
||||
if (!bridgeTestSource.includes("'猫'.repeat(100000)")) {
|
||||
throw new Error('mobile shell clipboard tests must cover Unicode truncation');
|
||||
}
|
||||
|
||||
if (
|
||||
!hapticsSource.includes('normalizeHostBridgeHapticsImpactStyle(rawStyle)') ||
|
||||
|
||||
@@ -709,6 +709,17 @@ describe('handleMobileHostBridgeMessage', () => {
|
||||
|
||||
expect(expectOk(response).result).toBe(true);
|
||||
expect(Clipboard.setStringAsync).toHaveBeenCalledWith('a'.repeat(100000));
|
||||
|
||||
vi.mocked(Clipboard.setStringAsync).mockClear();
|
||||
|
||||
const unicodeResponse = await send(
|
||||
request('clipboard.writeText', {
|
||||
text: '猫'.repeat(100010),
|
||||
}),
|
||||
);
|
||||
|
||||
expect(expectOk(unicodeResponse).result).toBe(true);
|
||||
expect(Clipboard.setStringAsync).toHaveBeenCalledWith('猫'.repeat(100000));
|
||||
});
|
||||
|
||||
test('clipboard.readText 读取失败时返回 host_error', async () => {
|
||||
|
||||
Reference in New Issue
Block a user