From b7a3da8176284d3ae1d6ff9c5687a8d459e956b9 Mon Sep 17 00:00:00 2001 From: thzxx <1440196015@qq.com> Date: Sat, 25 Jul 2026 17:41:14 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E7=BC=93=E5=AD=98=E6=B7=98=E6=B1=B0?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=94=A8=E6=9E=81=E7=9F=AD=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E6=9B=BF=E4=BB=A3=E5=AE=8C=E6=95=B4=20parseMarkdown=EF=BC=8CCI?= =?UTF-8?q?=20=E6=8F=90=E9=80=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/parser.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/parser.test.ts b/tests/parser.test.ts index d607431..8fcfca1 100644 --- a/tests/parser.test.ts +++ b/tests/parser.test.ts @@ -908,10 +908,10 @@ describe('parseMarkdown - v0.1.15 registerBlockHandler', () => { describe('parseMarkdown - 覆盖率:渲染缓存淘汰', () => { test('缓存超过上限触发 FIFO 淘汰', () => { - // MAX_CACHE_SIZE = 300,填充 301 个不同文本触发淘汰 + // MAX_CACHE_SIZE = 300,填充 301 个极短文本触发淘汰(避免 CI 超时) + const short = 'x'; for (let i = 0; i < 301; i++) { - const text = `text ${i} **bold**`; - parseMarkdown(text); + parseMarkdown(short + i); } // 不应抛错,且至少有一次淘汰发生 expect(true).toBe(true);