summaryrefslogtreecommitdiff
path: root/test/ui_review.py
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-20 00:36:50 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commitc1990b3e6e196ad41379aa432bf3ccca8a65d9f0 (patch)
treed7ad5afe559f7f56464b14c3122242fa3f16399b /test/ui_review.py
parent717afaf3177a2e0925b18ae3445119efe808b129 (diff)
downloadpardes-c1990b3e6e196ad41379aa432bf3ccca8a65d9f0.tar.gz
pardes-c1990b3e6e196ad41379aa432bf3ccca8a65d9f0.zip
Flatten the 9P control tree and move it out of fs.zig
The served tree loses the self/ level: /index /ctl /new /log /screen /listeners /pane/<n>/... /os, with /src only in -Dembed-sources=true builds (default off, on for esp32p4). ctl speaks the editor's own language with two lowercase verbs, look TEXT and exec TEXT, plus acme's addr verbs; the new/ factory directory becomes one clone file; cons is gone (exec Msg); name and sel are files; stats report real lengths, modes and mtimes; /log streams pane new/del/rename/save events. The tree code lives in src/ninep/ (tree, pane, ctl, addr, pty, events, screen, sources); fs.zig keeps host access, mounts, resolution and find/grep. Same engine and transports. README (fs-help.txt) and docs rewritten; tests updated and extended. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Diffstat (limited to 'test/ui_review.py')
-rw-r--r--test/ui_review.py50
1 files changed, 25 insertions, 25 deletions
diff --git a/test/ui_review.py b/test/ui_review.py
index df492eac..2b6faa29 100644
--- a/test/ui_review.py
+++ b/test/ui_review.py
@@ -21,7 +21,7 @@ from fs import session
def panes(client):
return {int(row.split(maxsplit=5)[0]): row.split(maxsplit=5)[5]
- for row in client.read('/self/index').decode().splitlines()}
+ for row in client.read('/index').decode().splitlines()}
def wait_for(fn, seconds=12):
deadline = time.monotonic() + seconds
@@ -34,7 +34,7 @@ def wait_for(fn, seconds=12):
def command(client, serial, text):
"""Execute a temporary tag command without changing source contents."""
- tag = f'/self/pane/{serial}/tag'
+ tag = f'/pane/{serial}/tag'
before = client.read(tag).rstrip(b'\n')
tail_start = before.index(b'Save Tty Del')
while tail_start and before[tail_start - 1:tail_start] == b' ':
@@ -42,13 +42,13 @@ def command(client, serial, text):
client.write(tag, b' ' + text.encode())
current = client.read(tag)
start = current.rfind(text.encode())
- client.write(f'/self/pane/{serial}/event', f'Mx{start} {start + len(text.encode())}\n'.encode())
- client.write(f'/self/pane/{serial}/ctl', b'cleartag\n')
+ client.write(f'/pane/{serial}/event', f'Mx{start} {start + len(text.encode())}\n'.encode())
+ client.write(f'/pane/{serial}/ctl', b'cleartag\n')
client.write(tag, before[tail_start:])
def new_output(client, before):
return next((serial for serial in panes(client) if serial not in before and
- client.read(f'/self/pane/{serial}/body').strip()), None)
+ client.read(f'/pane/{serial}/body').strip()), None)
def require(value, description):
if not value:
@@ -63,7 +63,7 @@ def capture(client, root, label, gui):
text = '\n'.join(''.join(cell[0] for cell in screen['cells'][at:at+cols])
for at in range(0, len(screen['cells']), cols))
(root / (label + '.txt')).write_text(text)
- (root / (label + '-index.txt')).write_text(client.read('/self/index').decode())
+ (root / (label + '-index.txt')).write_text(client.read('/index').decode())
if gui:
require(wait_for(lambda: (root / 'latest.ppm').exists(), 8), 'GPU capture missing')
def convert_frame():
@@ -106,28 +106,28 @@ def run(args):
before = panes(client)
command(client, source, 'Find crds_value')
find_pane = require(wait_for(lambda: new_output(client, before)), 'Find did not return results')
- require(b'crds_value.rs' in client.read(f'/self/pane/{find_pane}/body'), 'Find result missing source')
+ require(b'crds_value.rs' in client.read(f'/pane/{find_pane}/body'), 'Find result missing source')
report['find'] = True
capture(client, root, '02-find', not args.tty)
if find_pane:
- (root / 'find-results.txt').write_bytes(client.read(f'/self/pane/{find_pane}/body'))
- client.write(f'/self/pane/{find_pane}/ctl', b'del\n')
+ (root / 'find-results.txt').write_bytes(client.read(f'/pane/{find_pane}/body'))
+ client.write(f'/pane/{find_pane}/ctl', b'exec Del\n')
before = panes(client)
command(client, source, 'Grep CrdsValueLabel')
grep_pane = require(wait_for(lambda: new_output(client, before)), 'Grep did not return results')
- require(b'CrdsValueLabel' in client.read(f'/self/pane/{grep_pane}/body'), 'Grep result missing match')
+ require(b'CrdsValueLabel' in client.read(f'/pane/{grep_pane}/body'), 'Grep result missing match')
report['grep'] = True
if grep_pane:
- (root / 'grep-results.txt').write_bytes(client.read(f'/self/pane/{grep_pane}/body'))
+ (root / 'grep-results.txt').write_bytes(client.read(f'/pane/{grep_pane}/body'))
capture(client, root, '03-grep', not args.tty)
command(client, source, 'Tty')
terminal = require(wait_for(lambda: next((serial for serial in panes(client)
- if 'pty' in client.list(f'/self/pane/{serial}')), None)),
+ if 'pty' in client.list(f'/pane/{serial}')), None)),
'Tty did not create a terminal')
if terminal:
- client.write(f'/self/pane/{terminal}/pty/data', b"printf '\\033[1;36mAgave workspace\\033[0m\\n'; pwd; printf '\\033[32mRead-only UI review ready\\033[0m\\n'\r")
+ client.write(f'/pane/{terminal}/pty/data', b"printf '\\033[1;36mAgave workspace\\033[0m\\n'; pwd; printf '\\033[32mRead-only UI review ready\\033[0m\\n'\r")
require(wait_for(lambda: b'\nRead-only UI review ready\n' in
- client.read(f'/self/pane/{terminal}/body').replace(b'\r', b'')),
+ client.read(f'/pane/{terminal}/body').replace(b'\r', b'')),
'Terminal command output was not observed')
report['terminal'] = True
capture(client, root, '04-terminal', not args.tty)
@@ -137,46 +137,46 @@ def run(args):
symbols = wait_for(lambda: new_output(client, before), args.lsp_wait)
report['symbols'] = 'returned results' if symbols else 'no output before deadline'
if symbols:
- (root / 'symbols-results.txt').write_bytes(client.read(f'/self/pane/{symbols}/body'))
+ (root / 'symbols-results.txt').write_bytes(client.read(f'/pane/{symbols}/body'))
capture(client, root, '05-symbols', not args.tty)
if symbols:
- client.write(f'/self/pane/{symbols}/ctl', b'del\n')
+ client.write(f'/pane/{symbols}/ctl', b'exec Del\n')
offset = original.index(b'CrdsValue {')
- client.write(f'/self/pane/{source}/addr', f'#{offset},#{offset}'.encode())
- client.write(f'/self/pane/{source}/ctl', b'dot=addr\nshow\n')
+ client.write(f'/pane/{source}/addr', f'#{offset},#{offset}'.encode())
+ client.write(f'/pane/{source}/ctl', b'dot=addr\nshow\n')
before = panes(client)
command(client, source, 'Hover')
hover = wait_for(lambda: new_output(client, before), args.lsp_wait)
report['hover'] = 'returned results' if hover else 'no output before deadline'
if hover:
- (root / 'hover-results.txt').write_bytes(client.read(f'/self/pane/{hover}/body'))
+ (root / 'hover-results.txt').write_bytes(client.read(f'/pane/{hover}/body'))
capture(client, root, '06-hover', not args.tty)
# Look focuses the source without changing it; gd then travels through
# the host's real input parser, unlike tag builtin dispatch above.
line = original[:original.index(b'impl Sanitize for CrdsValue')].count(b'\n') + 1
- client.write(f'/self/pane/{source}/ctl', f'look {source_path}:{line}:19\n'.encode())
+ client.write(f'/pane/{source}/ctl', f'look {source_path}:{line}:19\n'.encode())
os.write(terminal_handle['input_fd'], b'gd')
time.sleep(1)
capture(client, root, '07-definition', not args.tty)
command(client, source, 'Lspinfo')
lsp = wait_for(lambda: next((serial for serial, tag in panes(client).items() if '+Lsp' in tag), None))
if lsp:
- info = client.read(f'/self/pane/{lsp}/body')
+ info = client.read(f'/pane/{lsp}/body')
(root / 'lsp-info.txt').write_bytes(info)
report['lsp'] = info.decode()
capture(client, root, '08-lsp-info', not args.tty)
if lsp:
- client.write(f'/self/pane/{lsp}/ctl', b'del\n')
+ client.write(f'/pane/{lsp}/ctl', b'exec Del\n')
for theme in args.themes:
command(client, source, 'Theme ' + theme)
capture(client, root, 'theme-' + theme, not args.tty)
for serial, tag in panes(client).items():
if any(word in tag for word in ['+Hover', '+Search']):
- (root / f'pane-{serial}.txt').write_bytes(client.read(f'/self/pane/{serial}/body'))
- assert client.read(f'/self/pane/{source}/body') == original == source_path.read_bytes()
+ (root / f'pane-{serial}.txt').write_bytes(client.read(f'/pane/{serial}/body'))
+ assert client.read(f'/pane/{source}/body') == original == source_path.read_bytes()
report['source_unchanged'] = True
if terminal:
- client.write(f'/self/pane/{terminal}/pty/data', b'exit\r')
+ client.write(f'/pane/{terminal}/pty/data', b'exit\r')
(root / 'report.json').write_text(json.dumps(report, indent=2))
print('artifacts', root, flush=True)