Guard nested remaps oword staging paths

This commit is contained in:
2026-06-13 08:32:39 +08:00
parent 234a1cf81c
commit 035cd8fa68
3 changed files with 84 additions and 13 deletions

View File

@@ -4647,10 +4647,13 @@
return wasmDir;
}
function assertRemapRegressionStaging(name, files, wasmDir) {
function assertRemapRegressionStaging(name, files, wasmDir, expectedUnstagedFiles = []) {
if (files.length === 0 || new Set(files).size !== files.length) {
throw new Error(`browser_remap_${name}_fixture_coverage: list drift`);
}
if (expectedUnstagedFiles.some((file) => files.includes(file))) {
throw new Error(`browser_remap_${name}_unstaged_fixture_overlap: list drift`);
}
const remapStagedRelativeFiles = files.map((file) => `${wasmDir}/${file}`.replace(`/work/browser-remap/${name}/`, ""));
if (remapStagedRelativeFiles.join(",") !== files.join(",")) {
throw new Error(`browser_remap_${name}_staging_manifest: list drift`);
@@ -6134,17 +6137,27 @@
].join("\n"),
);
const nestedRemapsOwordFiles = [
"test.ini",
"test.ngc",
"rm400.ngc",
"rm401.ngc",
"rm402.ngc",
"rm403.ngc",
];
const nestedRemapsOwordUnstagedFiles = [
"testsub.ngc",
];
const nestedRemapsOwordDir = await writeRemapRegressionFiles(
interp,
"nested-remaps-oword",
[
"test.ini",
"test.ngc",
"rm400.ngc",
"rm401.ngc",
"rm402.ngc",
"rm403.ngc",
],
nestedRemapsOwordFiles,
);
assertRemapRegressionStaging(
"nested-remaps-oword",
nestedRemapsOwordFiles,
nestedRemapsOwordDir,
nestedRemapsOwordUnstagedFiles,
);
verifyExpectedOutput(
"browser_nested_remaps_oword_remap",