From 12d387e4a03204a2b6d0c51633e228063e883fad Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 09:50:21 -0300 Subject: A root commands file lists every builtin, its argument and which ctl takes it A script could learn the builtin words only from source or the Help window. /commands is generated from the registry: one line per builtin, Word or Word arg, then root or pane for the ctl that takes it, so it is always this build's own list. Co-Authored-By: Claude Opus 5.5 --- test/fs.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/fs.py b/test/fs.py index 82d7cf0b..bafe665c 100644 --- a/test/fs.py +++ b/test/fs.py @@ -261,6 +261,10 @@ def discovery(binary, embedded=False): raise AssertionError(f'{path} took {line!r}') except OSError as refused: assert why in str(refused), refused + commands = client.read('/commands').decode().splitlines() + assert 'Newcol root' in commands and 'Save arg pane' in commands, commands + assert all(row.split()[-1] in ('root', 'pane') for row in commands), commands + assert client.stat('/commands')['length'] == len('\n'.join(commands)) + 1 client.write(f'/pane/{first}/ctl', b'Msg said through ctl\n') assert 'said through ctl' in ''.join(cell[0] for cell in client.screen()['cells']) assert set(client.list('/pane')) == {'new', str(fixture), str(first), str(second)} @@ -333,7 +337,7 @@ def discovery(binary, embedded=False): assert client.read('/src/pardes.zig').startswith(b'const std') assert client.stat('/src/pardes.zig')['mode'] == 0o444 assert b'pub const Pardes' in client.read(f'/pane/{look(client, "/virtual/src/pardes.zig")}/body') - print('9P discovery: listing/stat/find are inert; new, remove, look, exec, name, sel, log, ctl lock, focus and the ctl split behave') + print('9P discovery: listing/stat/find are inert; new, remove, look, exec, name, sel, log, ctl lock, focus, the ctl split and commands behave') def run_file(binary): -- cgit v1.3