path-free: a shared build folder outside home is not a leak (only home and user-name paths are private)

This commit is contained in:
CRTkafa 2026-10-26 20:13:11 +07:00
parent efa9503a50
commit 0858f4e538
3 changed files with 11 additions and 1 deletions

View file

@ -74,6 +74,10 @@ describe('leak scan', () => {
test('needles are named by kind; /Users/<user>/ is dropped when it equals the home folder', () => {
expect(needles.map(n => n.kind)).toEqual(['home folder', 'checkout']);
});
test('a shared build folder outside the home folder is not a needle (dsymutil / module cache paths there are fine)', () => {
expect(leakNeedles({ home: '/Users/you', user: 'you', root: '/Users/Shared/ship/app/abc' }).map(n => n.kind)).toEqual(['home folder']);
expect(leakNeedles({ home: '/Users/you', user: 'you', root: '/opt/builds/you/app' }).map(n => n.kind)).toEqual(['home folder', 'checkout']);
});
test('counts hits, keeps first offsets per file, scans app, dSYMs and Symbols', () => {
const r = scanForPaths(archiveScanDirs(arch), needles);
expect(r.files).toBe(2);