fix(native): preserve definitive failures alongside operational diagnostics

This commit is contained in:
morluto
2026-10-08 19:52:21 +08:00
parent 38e2a342d1
commit bd2655e6c5
3 changed files with 43 additions and 11 deletions
@@ -64,3 +64,23 @@ it("excludes complete selected paths with embedded newlines before classifying r
expect(result.status).toBe("invalid");
expect(result.diagnostics.join("\n")).toContain(path);
});
it("preserves definitive invalidity when other components have operational failures", async () => {
const path = "/Applications/Fixture.app";
const capture = await new NativeFixtureRunner().run("codesign", [
"--verify",
path,
]);
if (!capture.ok) throw capture.error;
const observed = signatureVerification(
{
...capture.value,
exitCode: 1,
stderr: `${path}/Contents/Helpers/one: permission denied\n${path}/Contents/Helpers/two: invalid signature\n`,
},
path,
false,
);
expect(observed.status).toBe("invalid");
expect(observed.diagnostics).toHaveLength(2);
});