wwdump: fail ast mode on parser errors

This commit is contained in:
2026-08-09 04:02:11 +09:00
parent 00d0ed502d
commit a85306e68f
2 changed files with 5 additions and 0 deletions

View File

@@ -135,6 +135,10 @@ fn dumprow(td: str, name: str, mode: str, src: str,
"package main;\nexport fn main() i32 = { return 0; };\n");
let co: testenv.commandout;
dumprow(td, "bad_a", "-a", badp, &co);
if (co.code == 0) {
fail("bad_a", "AST dump returned rc=0 on parse-errored input");
};
dumprow(td, "bad_c", "-c", badp, &co);
if (co.code == 0 || co.stdout.len != 0) {
fail("bad_c",