diff options
| author | blasty <blasty@local> | 2026-07-25 15:55:36 +0200 |
|---|---|---|
| committer | blasty <blasty@local> | 2026-07-25 15:55:36 +0200 |
| commit | 26272d060d061bbc782959b4b764121b1ea9c779 (patch) | |
| tree | 1384dd518dd0ae7388043e5cc343cf9fb3da6d58 /tests | |
| parent | projects: open the Ctrl+O switcher on the binary you're already in (diff) | |
| download | ida-tui-26272d060d061bbc782959b4b764121b1ea9c779.tar.gz ida-tui-26272d060d061bbc782959b4b764121b1ea9c779.tar.xz ida-tui-26272d060d061bbc782959b4b764121b1ea9c779.zip | |
strings: F2 widens the strings browser to the whole project
Completes phase 2 — the index already carried strings (KIND_STRING), the palette
just didn't offer the toggle. StringsPalette now mirrors SymbolPalette: F2 flips
between this binary and the project, project rows are prefixed with their binary,
and choosing a literal in another binary switches to it and jumps.
Ranking matches the symbol side: the trigram index guarantees the match, so
ordering is earliest-match then shortest, with a (binary, addr) tiebreak — the
same tie that crashed symbol search when two binaries shared a name, avoided here
by construction. Project scope caps at 60 like symbols.
_results is now (binary, addr, text) tuples in both palettes, so _on_string_chosen
takes the same (binary, addr) choice and routes through _switch_then_goto.
test_project_ui.py: local scope stays single-binary, F2 spans >=2 binaries
(23 checks). Suite 191/0.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_project_ui.py | 18 | ||||
| -rw-r--r-- | tests/test_scenarios.py | 4 |
2 files changed, 20 insertions, 2 deletions
diff --git a/tests/test_project_ui.py b/tests/test_project_ui.py index e3bfb62..731811d 100644 --- a/tests/test_project_ui.py +++ b/tests/test_project_ui.py @@ -168,6 +168,24 @@ async def run(bins): await pilot.press("escape") await pilot.pause(0.2) + # -- and the same toggle for strings --------------------------- # + from idatui.app import StringsPalette + await pilot.press("quotation_mark") + if await settle(lambda: isinstance(app.screen, StringsPalette), 30): + pal = app.screen + pal.query_one(Input).value = "usage" + await pilot.pause(0.3) + local = {b for b, _, _ in pal._results} + await pilot.press("f2") + await pilot.pause(0.4) + wide = {b for b, _, _ in pal._results} + check("strings: local scope is this binary only", local == {None}, + f"{local}") + check("strings: F2 widens across the project", + len(wide) >= 2 and None not in wide, f"{wide}") + await pilot.press("escape") + await pilot.pause(0.2) + # -- the promise: nothing was written next to the sources ---------- # left = sorted(os.listdir(src)) check("the source tree stays pristine (no .i64/scratch beside it)", diff --git a/tests/test_scenarios.py b/tests/test_scenarios.py index 7c41f1f..49bb6b9 100644 --- a/tests/test_scenarios.py +++ b/tests/test_scenarios.py @@ -424,10 +424,10 @@ async def s_strings(c: Ctx): pal.query_one(Input).value = frag await c.pause(0.2) ok = (pal._results - and all(frag.lower() in s.text.lower() for s in pal._results)) + and all(frag.lower() in t.lower() for _, _, t in pal._results)) c.check("filtering narrows to matching strings", bool(ok), f"frag={frag!r} n={len(pal._results)}") - want = pal._results[0].addr + want = pal._results[0][1] await c.press("enter") await c.wait(lambda: not isinstance(app.screen, StringsPalette), 10) landed = await c.wait(lambda: c.lst._cursor_ea() == want, 20) |
