feat: 0.10.1 忽略规则字符通配与收尾打磨 - 段内?单字符与[abc]/[a-z]/[!abc]字符类通配(未闭合与空类退化字面量、非法类体回退字面量永不崩溃、既有*/**/否定语义回归锚固化)、快照保存批量读取遮罩显示已读取N/M进度(文件数口径与扫描进度反馈对称)、差异文件导航游标不在序列时隐藏导航组(修双击same条目与对照模式fixed条目的—计数与死按钮)、修复0.10.0遗留snapshotDiff.test版本号类型错误(展开构造替代非法字面量传参)、修正E2E用例数记载(28→27),新增16用例(612单测+E2E 27全过覆盖率98.2/93.46/93.77/98.2),文档四件套同步
This commit is contained in:
@@ -734,6 +734,27 @@ describe('scanFolders - 忽略规则', () => {
|
||||
}
|
||||
})
|
||||
|
||||
it('段内 ? 与字符类规则跳过文件(0.10.1 字符通配集成)', async () => {
|
||||
const l = await mkdtemp(join(tmpdir(), 'difflens-ign9-l-'))
|
||||
const r = await mkdtemp(join(tmpdir(), 'difflens-ign9-r-'))
|
||||
try {
|
||||
for (const d of [l, r]) {
|
||||
await writeFile(join(d, 'keep.txt'), 'a')
|
||||
await writeFile(join(d, 'debug.log'), 'x')
|
||||
await writeFile(join(d, 'debug.leg'), 'x')
|
||||
await writeFile(join(d, 'main.c'), 'x')
|
||||
await writeFile(join(d, 'main.o'), 'x')
|
||||
}
|
||||
// *.l?g 命中 .log 与 .leg(? 匹配任意单字符);*.[ch] 命中 .c 不命中 .o
|
||||
const res = await scanFolders(l, r, { ignore: ['*.l?g', '*.[ch]'] })
|
||||
expect(res.entries.map((e) => e.rel).sort()).toEqual(['keep.txt', 'main.o'])
|
||||
expect(res.total).toBe(2)
|
||||
} finally {
|
||||
await rm(l, { recursive: true, force: true })
|
||||
await rm(r, { recursive: true, force: true })
|
||||
}
|
||||
})
|
||||
|
||||
it('空规则数组与全非法规则不产生任何剪枝(行为与无规则一致)', async () => {
|
||||
const l = await mkdtemp(join(tmpdir(), 'difflens-ign5-l-'))
|
||||
const r = await mkdtemp(join(tmpdir(), 'difflens-ign5-r-'))
|
||||
|
||||
Reference in New Issue
Block a user