From e2a0cf94c46cc2e668a73660bc684316bc8b86d3 Mon Sep 17 00:00:00 2001 From: Jon Hemstreet Date: Thu, 22 Oct 2026 15:27:31 -0600 Subject: [PATCH] Goldens are measured from a factory start, and twice: -A ignores the machine's saved settings, and an answer that changes run to run is not measured --- scripts/vfp-expected.mjs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/vfp-expected.mjs b/scripts/vfp-expected.mjs index 94811ff..fd745c9 100644 --- a/scripts/vfp-expected.mjs +++ b/scripts/vfp-expected.mjs @@ -204,7 +204,7 @@ export async function askVfp(source, { timeoutMs = TIMEOUT_MS } = {}) { stage(run); writeFileSync(join(dir, 'probe.prg'), WRAPPER); await new Promise((done) => { - const child = execFile(VFP, [join(dir, 'probe.prg')], { cwd: run }, () => done()); + const child = execFile(VFP, ['-A', join(dir, 'probe.prg')], { cwd: run }, () => done()); const timer = setTimeout(() => { try { child.kill(); @@ -387,7 +387,17 @@ async function main() { const source = readFileSync(path, 'latin1'); const answer = await askVfp(source); const name = basename(path); - const why = whyNotMeasured(answer); + let why = whyNotMeasured(answer); + if (!why) { + // Asked twice, because an answer that changes from run to run - a clock, the record of a + // time - is not a golden either, and nothing in a single run says so. The second run also + // has to be measurable: a program that asked a person once may not ask the next time. + const again = await askVfp(source); + why = whyNotMeasured(again); + if (!why && answer.text !== again.text) { + why = 'what it printed changes from run to run'; + } + } if (why) { unmeasured += 1; manifest.set(name, why);