Guard INI subroutine staging manifests

This commit is contained in:
2026-06-12 23:11:21 +08:00
parent b84dfbdcf0
commit 3b0e8df639
3 changed files with 137 additions and 0 deletions

View File

@@ -7239,6 +7239,22 @@
);
const subCallFromSubPlan = await stageInterpIniContext(interp, "sub-call-from-sub");
const subCallFromSubNgcFiles = [
"subs/caller.ngc",
"subs/helper.ngc",
"test.ngc",
];
if (subCallFromSubNgcFiles.length !== 3 || new Set(subCallFromSubNgcFiles).size !== subCallFromSubNgcFiles.length) {
throw new Error("browser_interp_sub_call_from_sub_fixture_coverage: list drift");
}
const subCallFromSubStagedNgcFiles = subCallFromSubPlan.files
.map((file) => file.sourceRel)
.filter((sourceRel) => sourceRel.endsWith(".ngc"))
.map((sourceRel) => sourceRel.replace("tests/interp/sub-call-from-sub/", ""))
.sort();
if (subCallFromSubStagedNgcFiles.join(",") !== subCallFromSubNgcFiles.join(",")) {
throw new Error("browser_interp_sub_call_from_sub_staging_manifest: list drift");
}
verifyExpectedOutput(
"browser_interp_sub_call_from_sub",
interp.runFileWithIni(
@@ -7294,6 +7310,21 @@
interp,
"nested-sub-in-file-error",
);
const nestedSubInFileErrorNgcFiles = [
"subs/sequential.ngc",
"test.ngc",
];
if (nestedSubInFileErrorNgcFiles.length !== 2 || new Set(nestedSubInFileErrorNgcFiles).size !== nestedSubInFileErrorNgcFiles.length) {
throw new Error("browser_interp_nested_sub_in_file_error_fixture_coverage: list drift");
}
const nestedSubInFileErrorStagedNgcFiles = nestedSubInFileErrorPlan.files
.map((file) => file.sourceRel)
.filter((sourceRel) => sourceRel.endsWith(".ngc"))
.map((sourceRel) => sourceRel.replace("tests/interp/nested-sub-in-file-error/", ""))
.sort();
if (nestedSubInFileErrorStagedNgcFiles.join(",") !== nestedSubInFileErrorNgcFiles.join(",")) {
throw new Error("browser_interp_nested_sub_in_file_error_staging_manifest: list drift");
}
verifyExpectedOutput(
"browser_interp_nested_sub_in_file_error",
interp.runFileWithIni(