From 3787ec5f83eae15f8342c4191bdb88ab690adc13 Mon Sep 17 00:00:00 2001 From: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> Date: Sat, 24 Oct 2026 02:31:32 +0800 Subject: [PATCH] test(ida): align native search fixtures with Unicode folding (#6898) --- src/ida/IdaNativeProtocol.test.ts | 33 ++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/src/ida/IdaNativeProtocol.test.ts b/src/ida/IdaNativeProtocol.test.ts index 415a8f0f4d..f99091687c 100644 --- a/src/ida/IdaNativeProtocol.test.ts +++ b/src/ida/IdaNativeProtocol.test.ts @@ -715,6 +715,9 @@ describe("native IDA literal matching", () => { "literal[bracket", "a\\b", "🧪", + "Σ", + "ΟΣ", + "ος", ]; producer.overrideCall = (name, args) => { if (name !== "find_regex") return undefined; @@ -755,12 +758,36 @@ describe("native IDA literal matching", () => { case_sensitive: false, expected: ["İstanbul"], }, - { pattern: "σ", mode: "literal", case_sensitive: false, expected: ["σ"] }, + // Match the shared Unicode contract after the byte-oriented producer has + // returned candidates, including final sigma inside a word. + ...["σ", "ς", "Σ"].map((pattern) => ({ + pattern, + mode: "literal", + case_sensitive: false, + expected: ["σ", "ς", "Σ", "ΟΣ", "ος"], + })), + ...["ΟΣ", "ος"].map((pattern) => ({ + pattern, + mode: "literal", + case_sensitive: false, + expected: ["ΟΣ", "ος"], + })), + ...[ + { pattern: "σ", expected: ["σ"] }, + { pattern: "ς", expected: ["ς", "ος"] }, + { pattern: "Σ", expected: ["Σ", "ΟΣ"] }, + { pattern: "ΟΣ", expected: ["ΟΣ"] }, + { pattern: "ος", expected: ["ος"] }, + ].map((query) => ({ + ...query, + mode: "literal", + case_sensitive: true, + })), { pattern: "σ", mode: "regex", case_sensitive: false, - expected: ["σ", "ς"], + expected: ["σ", "ς", "Σ", "ΟΣ", "ος"], }, { pattern: "[", @@ -792,7 +819,7 @@ describe("native IDA literal matching", () => { const before = producer.calls.length; const result = await client.execute("search_strings", query); if (!result.ok) throw result.error; - expect(result.value.result).toEqual( + expect(result.value.result, JSON.stringify(query)).toEqual( expected.map((value) => ({ address: `0x${(0x3000 + values.indexOf(value)).toString(16)}`, value,