summaryrefslogtreecommitdiff
path: root/test/fs.py
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 09:50:21 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit12d387e4a03204a2b6d0c51633e228063e883fad (patch)
tree9d1af954cacbbc90f60bd85499088865c786f993 /test/fs.py
parentf5eaddb2cf28a9b72d5dd5b3b10502a316d4de85 (diff)
downloadpardes-12d387e4a03204a2b6d0c51633e228063e883fad.tar.gz
pardes-12d387e4a03204a2b6d0c51633e228063e883fad.zip
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 <[email protected]>
Diffstat (limited to 'test/fs.py')
-rw-r--r--test/fs.py6
1 files changed, 5 insertions, 1 deletions
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):