mirror of
https://github.com/morluto/rea.git
synced 2026-11-07 15:26:25 +00:00
fix(setup): spell IDA and JADX in interactive completion (#9149)
This commit is contained in:
2 files changed
+40
-1
No files matched your search
@@ -275,8 +275,15 @@ const readyAgentClients = (
|
||||
const readyProviders = (result: SetupResult): readonly string[] =>
|
||||
result.doctor.availableProviders.map(displayProviderId);
|
||||
|
||||
/** Product spellings that title case would distort. Lookup ids stay lowercase. */
|
||||
const PROVIDER_DISPLAY_NAMES: Readonly<Record<string, string>> = {
|
||||
ida: "IDA",
|
||||
jadx: "JADX",
|
||||
};
|
||||
|
||||
const displayProviderId = (id: string): string =>
|
||||
id.length === 0 ? id : `${id[0]?.toUpperCase() ?? ""}${id.slice(1)}`;
|
||||
PROVIDER_DISPLAY_NAMES[id] ??
|
||||
(id.length === 0 ? id : `${id[0]?.toUpperCase() ?? ""}${id.slice(1)}`);
|
||||
|
||||
const humanList = (values: readonly string[]): string => {
|
||||
if (values.length < 2) return values[0] ?? "";
|
||||
|
||||
@@ -493,6 +493,38 @@ describe("interactive setup completion", () => {
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
it("prints IDA and JADX with their product spellings", async () => {
|
||||
const { stderr } = await execute(
|
||||
process.execPath,
|
||||
[
|
||||
"--input-type=module",
|
||||
"--eval",
|
||||
[
|
||||
'import { renderInteractiveSetupResult } from "./dist/cli/interactiveSetup.js";',
|
||||
"renderInteractiveSetupResult({",
|
||||
' status: "ready",',
|
||||
" plannedActions: [],",
|
||||
" appliedActions: [],",
|
||||
" clients: {},",
|
||||
" doctor: {",
|
||||
" healthy: true,",
|
||||
' availableProviders: ["hopper", "ghidra", "ida", "jadx", "kuna"],',
|
||||
" checks: [],",
|
||||
" },",
|
||||
"}, {});",
|
||||
].join("\n"),
|
||||
],
|
||||
{ cwd: process.cwd(), env: { ...process.env, NO_COLOR: "1" } },
|
||||
);
|
||||
|
||||
expect(stderr).toContain(
|
||||
"Deep analysis: Hopper, Ghidra, IDA, JADX, and Kuna",
|
||||
);
|
||||
expect(stderr).not.toContain("Ida");
|
||||
expect(stderr).not.toContain("Jadx");
|
||||
});
|
||||
|
||||
it("prints retained cleanup resources without relying on paths in remediation", async () => {
|
||||
const resources = ["/fixture/owned backup", "/fixture/临时目录"];
|
||||
const result: SetupResult = {
|
||||
|
||||
Reference in new issue
Block a user