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

@@ -246,15 +246,20 @@ function writeRemapRegressionFiles(name, files) {
return wasmDir;
}
function assertRemapRegressionStaging(name, files, wasmDir) {
function assertRemapRegressionStaging(name, files, wasmDir, expectedUnstagedFiles = []) {
const sourceDir = resolve(rootDir, "vendor/linuxcnc/tests/remap", name);
assert.deepEqual(
readdirSync(sourceDir)
.filter((filename) => filename.endsWith(".ini") || filename.endsWith(".ngc"))
.sort(),
[...files].sort(),
[...files, ...expectedUnstagedFiles].sort(),
`remap ${name} fixture coverage drift`,
);
assert.deepEqual(
files.filter((file) => expectedUnstagedFiles.includes(file)),
[],
`remap ${name} unstaged fixture overlap drift`,
);
assert.deepEqual(
files.map((file) => `${wasmDir}/${file}`),
files.map((file) => `/work/remap/${name}/${file}`),
@@ -1110,14 +1115,27 @@ verifyExpectedOutput(
].join("\n"),
);
const nestedRemapsOwordDir = writeRemapRegressionFiles("nested-remaps-oword", [
const nestedRemapsOwordFiles = [
"test.ini",
"test.ngc",
"rm400.ngc",
"rm401.ngc",
"rm402.ngc",
"rm403.ngc",
]);
];
const nestedRemapsOwordUnstagedFiles = [
"testsub.ngc",
];
const nestedRemapsOwordDir = writeRemapRegressionFiles(
"nested-remaps-oword",
nestedRemapsOwordFiles,
);
assertRemapRegressionStaging(
"nested-remaps-oword",
nestedRemapsOwordFiles,
nestedRemapsOwordDir,
nestedRemapsOwordUnstagedFiles,
);
verifyExpectedOutput(
"nested_remaps_oword_remap_wasm",
interp.runRemapFile(