summaryrefslogtreecommitdiff
path: root/test/fs.py
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-04 11:03:55 -0300
committerGabriel Schneider <[email protected]>2026-11-04 11:03:55 -0300
commit21e09998114a866ae76ecef68d660e84561daa44 (patch)
tree12237b50e772df336e2c8fc7d59cfd69607d4afb /test/fs.py
parent5752e5c94f27eced137f4ca061c68715d8b7131a (diff)
downloadpardes-21e09998114a866ae76ecef68d660e84561daa44.tar.gz
pardes-21e09998114a866ae76ecef68d660e84561daa44.zip
test: the process runner, test/process.zig (docs/next-tests.md, the user's one runner): Files, a running pardes's file tree over its socket with Session's method names (read, write, expect, keys, click, where, screen, focused, newPane, at), dialled by pid or path, and Detached, a `pardes --detach` in a throwaway root that is its HOME, runtime and config directory, with no daemon (PARDES_DAEMON=off) so nothing outlives it, its stderr kept and said if it exits early; the pty mode is e2e_harness's Harness with process.of; the process-test step runs test/process_test.zig over test/process/*.zig, its first case fs.py's keys_and_mouse (gone from fs.py); snap9p reads /screen through Files; all 113 snap scripts pass
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/fs.py')
-rw-r--r--test/fs.py37
1 files changed, 0 insertions, 37 deletions
diff --git a/test/fs.py b/test/fs.py
index 5690cedc..c5dd6234 100644
--- a/test/fs.py
+++ b/test/fs.py
@@ -1095,42 +1095,6 @@ def cut_writes(binary):
assert (screen['cols'], screen['rows']) == (132, 40), (screen['cols'], screen['rows'])
-def find_on_screen(client, word):
- """Where `word` is drawn, as (col, row), off /screen: what a mousein
- line clicks."""
- screen = client.screen()
- cols = screen['cols']
- for row in range(screen['rows']):
- line = ''.join(cell[0] or ' ' for cell in screen['cells'][row * cols:(row + 1) * cols])
- at = line.find(word)
- if at >= 0:
- return at, row
- raise AssertionError((word, 'not on the screen'))
-
-
-def keys_and_mouse(binary):
- """kbdin and mousein: a script types and clicks as the user does, each
- write done before it is answered, so no sleep or poll between a write
- and the read that checks it; where to click is read off /screen."""
- with tempfile.TemporaryDirectory(prefix='pardes-kbd-') as directory:
- root = Path(directory)
- (root / 'target.txt').write_bytes(b'hello-target\n')
- with session(binary, root, 'kbd') as (client, _):
- serial = new_pane(client, b'see \n')
- client.write('/focus', f'{serial}\n'.encode())
- client.write('/kbdin', 'Atarget.txt\x1b'.encode())
- assert client.read(f'/pane/{serial}/body') == b'see target.txt\n'
- col, row = find_on_screen(client, 'target.txt')
- client.write('/mousein', f'm {col + 2} {row} 4\nm {col + 2} {row} 0\n'.encode())
- opened = newest(client)
- assert opened != serial and client.read('/index').splitlines()[-1].endswith(b'target.txt 1'), client.read('/index')
- assert client.read(f'/pane/{opened}/body') == b'hello-target\n'
- # Undone from the keyboard, as the user would: u in normal mode.
- client.write('/focus', f'{serial}\n'.encode())
- client.write('/kbdin', b'u')
- assert client.read(f'/pane/{serial}/body') == b'see \n'
-
-
def edit_commands(binary):
"""Edit's `< | >` run off the loop and answer the write that ran them
once applied; a failing one changes nothing and fails the write in its
@@ -1243,7 +1207,6 @@ def edit_commands(binary):
def test(binary, quic=False):
started = time.monotonic()
- keys_and_mouse(binary)
cut_writes(binary)
edit_commands(binary)
odd_paths(binary)