aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_tui.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_tui.py')
-rw-r--r--tests/test_tui.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_tui.py b/tests/test_tui.py
index 0419842..f43c4a2 100644
--- a/tests/test_tui.py
+++ b/tests/test_tui.py
@@ -421,6 +421,25 @@ async def run(db):
dec.cursor == drow and dec.word_under_cursor() == dsym,
f"cursor={dec.cursor} (want {drow}) word={dec.word_under_cursor()!r}")
+ # Follow must still work when the name is stale (as right after a
+ # rename, before the pseudocode text catches up): the ea-marker
+ # fallback follows by address regardless of the (old) token.
+ dstale = app.program.resolve(dsym)
+ old_line = dec._texts[drow] if drow < len(dec._texts) else ""
+ if "/*0x" in old_line and dsym in old_line:
+ tmpname = f"stale_{os.getpid()}"
+ app.program.client.call(
+ "rename", batch={"func": {"addr": hex(dstale), "name": tmpname}})
+ app.program.bump_names()
+ d2 = len(app._nav)
+ app._follow_decomp(old_line, dsym) # dsym is now the OLD name
+ await wait_until(pilot, lambda: len(app._nav) > d2, timeout=25)
+ check("decomp follow works with a stale name (ea-marker fallback)",
+ app._cur.ea == dstale, f"cur={app._cur.ea:#x} want={dstale:#x}")
+ app.program.client.call(
+ "rename", batch={"func": {"addr": hex(dstale), "name": dsym}})
+ app.program.bump_names()
+
# Column sort: click headers to sort by name / address.
if app._filter_term:
app._apply_filter("")