commit 1db4fb98990e605822813b5e8a6f8778cc94ecc6
parent 58d877e65bb26e6325232da5a04e920da35cfcc1
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Mon, 28 Sep 2026 18:44:03 -0400
common(test): source.test expands the "~" the kept-scratch log line prints
The source step logs the kept scratch dir tildified with the real home dir,
so with TMPDIR under it the test captured "~/…" and existsSync read it as a
relative path: 12 of 13. The test now expands a leading "~" first; 13 of 13
with TMPDIR unset and with TMPDIR under the home dir. (Release 12's test; the
product never prints the real home, and still does not.)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/common/publish/source.test.ts b/common/publish/source.test.ts
@@ -549,9 +549,11 @@ test("a denied literal no rule removes: refused, nothing written, the report nev
// --keep-scratch keeps the clone for a look, never the scrub rules.
const kept = /scratch kept at (\S+) \(replace\.txt, the scrub rules, deleted\)/.exec(report);
assert.ok(kept, report);
- assert.ok(existsSync(path.join(kept[1], "bare")));
- assert.ok(!existsSync(path.join(kept[1], "replace.txt")));
- rmSync(kept[1], { recursive: true, force: true });
+ // The log tildifies with the real home dir, so a TMPDIR under it prints "~/…".
+ const keptDir = kept[1].replace(/^~(?=\/|$)/, os.homedir());
+ assert.ok(existsSync(path.join(keptDir, "bare")));
+ assert.ok(!existsSync(path.join(keptDir, "replace.txt")));
+ rmSync(keptDir, { recursive: true, force: true });
});
test("a refusal naming a tree path masks a literal that spans path components (review R2-L1)", async (t) => {