Add selected bad interpreter error fixtures

This commit is contained in:
2026-06-09 08:01:40 +08:00
parent e7df5b3eda
commit 45420b055a
12 changed files with 164 additions and 4 deletions

View File

@@ -1271,6 +1271,51 @@ verifyExpectedOutput(
].join("\n"),
);
for (const badFixture of [
{
name: "nested",
file: "nested.ngc",
readCount: 6,
executeCount: 5,
errorText: "Nested subroutine definition",
},
{
name: "no_feed_rate",
file: "no-feed-rate.ngc",
readCount: 2,
executeCount: 2,
errorText: "Cannot do g1 with zero feed rate",
},
{
name: "no_ijr",
file: "no-ijr.ngc",
readCount: 2,
executeCount: 2,
errorText: "R i j k words all missing for arc",
},
{
name: "probe_no_axes",
file: "probe-no-axes.ngc",
readCount: 2,
executeCount: 1,
errorText: "All axes missing with motion code",
},
]) {
const badPath = writeInterpRegressionFile("bad", badFixture.file);
verifyExpectedOutput(
`interp_bad_${badFixture.name}_wasm`,
interp.runFile(badPath),
[
"file_open=0",
`file_read_count=${badFixture.readCount}`,
`file_execute_count=${badFixture.executeCount}`,
"file_saw_error=1",
`file_error_text=${badFixture.errorText}`,
"canon_event=ON_RESET",
].join("\n"),
);
}
const g33_1Path = writeInterpRegressionFile("g33.1", "g33.1.ngc");
verifyExpectedOutput(
"interp_g33_1_wasm",