From 160d2ecdb5cfc65f531df4a6f6dca7b905a8a288 Mon Sep 17 00:00:00 2001 From: N0zoM1z0 <161784452+N0zoM1z0@users.noreply.github.com> Date: Wed, 11 Nov 2026 06:39:11 +0000 Subject: [PATCH] test(cli): bound selector regression startup work per case Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> --- .../boundary/cli/analysisSelectorCli.test.ts | 85 ++++++++++--------- 1 file changed, 45 insertions(+), 40 deletions(-) diff --git a/tests/boundary/cli/analysisSelectorCli.test.ts b/tests/boundary/cli/analysisSelectorCli.test.ts index 73a83ba82e..df18fff028 100644 --- a/tests/boundary/cli/analysisSelectorCli.test.ts +++ b/tests/boundary/cli/analysisSelectorCli.test.ts @@ -221,44 +221,49 @@ cliTest( }, ); -cliTest( - "compares native address values without folding symbols, spaces or text queries", - async ({ cli }) => { - for (const [command, option] of [ - ["xrefs", "address"], - ["function", "procedure"], - ["instructions", "procedure"], - ["decompile", "procedure"], - ["inspect-native-api", "procedure"], - ]) { - for (const [left, right, code] of [ - ["0x1a", "0x001A", "target_unavailable"], - ["ram:0x1", "RAM:0x1", "invalid_request"], - ["Symbol", "symbol", "invalid_request"], - ]) { - const result = await cli.run({ - arguments: [ - command!, - "does-not-exist", - left!, - `--${option}=${right}`, - "--json", - ], - }); - expect(result.json, `${command}: ${left}/${right}`).toMatchObject({ - code, - }); +for (const [command, option] of [ + ["xrefs", "address"], + ["function", "procedure"], + ["instructions", "procedure"], + ["decompile", "procedure"], + ["inspect-native-api", "procedure"], +] as const) { + cliTest( + `admits equivalent native coordinates through ${command}`, + async ({ cli }) => { + const result = await cli.run({ + arguments: [ + command, + "does-not-exist", + "0x1a", + `--${option}=0x001A`, + "--json", + ], + }); + expect(result.json).toMatchObject({ code: "target_unavailable" }); + if (command === "xrefs") { + for (const [left, right] of [ + ["ram:0x1", "RAM:0x1"], + ["Symbol", "symbol"], + ] as const) { + const conflict = await cli.run({ + arguments: [ + command, + "does-not-exist", + left, + `--${option}=${right}`, + "--json", + ], + }); + expect(conflict.json).toMatchObject({ code: "invalid_request" }); + } } - } - const result = await cli.run({ - arguments: [ - "search", - "does-not-exist", - "0x1a", - "--pattern=0x1A", - "--json", - ], - }); - expect(result.json).toMatchObject({ code: "invalid_request" }); - }, -); + }, + ); +} +cliTest("keeps address-looking search text exact", async ({ cli }) => { + const result = await cli.run({ + arguments: ["search", "does-not-exist", "0x1a", "--pattern=0x1A", "--json"], + }); + expect(result.json).toMatchObject({ code: "invalid_request" }); +});