test(hosts): pin the symlink guard and the regex anchor of the temp sweep (#38) #43

Merged
maximus merged 1 commit from issue-38-sweep-symlink-anchor-tests into main 2026-10-01 23:27:52 +00:00

1 commit

Author SHA1 Message Date
le king fu
198e1cf586 test(hosts): pin the symlink guard and the regex anchor of the temp sweep (#38)
All checks were successful
CI / verification (pull_request) Successful in 20s
CI / verification (push) Successful in 20s
Two promises of sweepStaleTempFiles() were held by no test:

- lstat, not stat: a symlink named like a temp file is neither followed
  nor removed. The link is aged too, so the isFile() guard is what keeps it.
- the ^ anchor of TEMP_FILE_RE: a temp name behind a prefix is never touched.

Each new case goes red under its mutation (statSync, anchor removed,
isFile() dropped); index.js itself is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 18:10:49 -04:00