fix: 排除破坏行框的组合字符

This commit is contained in:
necobot
2026-07-25 23:11:25 +08:00
parent 48c17799bc
commit 03bbb76a2c
2 changed files with 13 additions and 6 deletions
+12
View File
@@ -98,6 +98,18 @@ describe('generateMosaic', () => {
expect(expanded.outputLength).toBe(expanded.inputLength * 10)
})
it('不生成可能跳出正常行框的 Unicode 组合符', () => {
const outputs = Array.from({ length: 20 }, (_, seed) =>
generateMosaic(SOURCE, [], {
volume: 1000,
disorder: 100,
seed,
}).output,
).join('')
expect(outputs).not.toMatch(/\p{Mark}/u)
})
it('相同种子可复现,不同种子会重新侵蚀', () => {
const candidates = selectKeywords(SOURCE, 14, 1)
const first = generateMosaic(SOURCE, candidates, {