aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_project_ui.py18
-rw-r--r--tests/test_scenarios.py4
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)