mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 08:40:21 +00:00
refactor: centralize strict numeric parsing
This commit is contained in:
@@ -122,6 +122,19 @@ describe("launchd runtime parsing", () => {
|
||||
expect(info.pid).toBeUndefined();
|
||||
expect(info.state).toBe("waiting");
|
||||
});
|
||||
|
||||
it("rejects pid and exit status values with junk suffixes", () => {
|
||||
const output = [
|
||||
"state = waiting",
|
||||
"pid = 123abc",
|
||||
"last exit status = 7ms",
|
||||
"last exit reason = exited",
|
||||
].join("\n");
|
||||
expect(parseLaunchctlPrint(output)).toEqual({
|
||||
state: "waiting",
|
||||
lastExitReason: "exited",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("launchctl list detection", () => {
|
||||
|
||||
Reference in New Issue
Block a user