Guard nested remaps oword staging paths
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user