Guard staged prefix stripping

This commit is contained in:
2026-06-13 14:32:29 +08:00
parent dfc343b6e7
commit 1d40980fed
3 changed files with 77 additions and 2 deletions

View File

@@ -297,11 +297,21 @@ function assertInterpRegressionFileStaging(name, filename, wasmPath) {
);
}
function stripInterpIniContextStagingPrefix(name, wasmPath) {
const prefix = `/work/interp/${name}/`;
assert.equal(
wasmPath.startsWith(prefix),
true,
`interp ${name} staging prefix drift: ${wasmPath}`,
);
return wasmPath.slice(prefix.length);
}
function assertInterpIniContextNgcStaging(name, files, plan) {
assert.deepEqual(
plan.files
.filter((file) => file.sourceRel.endsWith(".ngc"))
.map((file) => file.wasmPath.replace(`/work/interp/${name}/`, ""))
.map((file) => stripInterpIniContextStagingPrefix(name, file.wasmPath))
.sort(),
files,
`interp ${name} staging manifest drift`,